Ad
  • Custom User Avatar

    I have 2 different solutions with 27...

  • Default User Avatar
         code within limit!
    would this be the only way?
         answers all differ
    
  • Custom User Avatar

    Most people will probably start from that approach, including me. That's exactly why the character threshold is set right below its length. If no minor "local" edit will shorten that approach further, you'll need to take a detour.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar
    1. The test structure should be given :
      • Tiny (2–9) (8 Assertions)
      • Small (10–15) (6 Assertions)
      • Medium (100–105) (6 Assertions)
      • Random tests
      • 30 Small tests (2–100)
      • 50 Medium tests (100–1000)
      • 50 Large tests (10000–20000)
      • 70 Huge tests (75000–80000)
    2. The formula f(n) = (n/2) mod m is ambiguous because it is not a modular division, it is a division by 2 in the integers and then a modulo.
    3. Small typo :

      be applied repeatealy .:

    4. The two first elements of valueVerificationArray (that should be in Python value_verification_array) are always the same...
  • Custom User Avatar

    Been thinking about a formula like this since when i created the questions.
    Well finally i choosed to change it.

    Thanks, and sorry the later response.

  • Custom User Avatar

    Since the function takes the parameter n and k in that order, i suggest changing the formula to :

    Noting :

    S_{n,k} = \sum_{i=1}^{2k-1}(-1)^{i+1}a_{k,n-i}
    

    We define :

    a_{n,k}=
    \begin{cases}
    0, & n \le 0\\
    S_n -(2k-1)n, & \left[ S_n>(2k-1)n \right] \, \text{and} \, \left[(S_n -(2k-1)n) \not \in \{a_{0, k}, a_{1, k},\cdots, a_{n-1, k}\}) \right ] \\
    S_n +(2k-1)n & \text{otherwise}
    \end{cases}
    
  • Custom User Avatar
  • Default User Avatar

    Very enjoyable, hinges between 6-7 kyu IMO.

  • Custom User Avatar
  • Custom User Avatar

    This kata was retired due to low user satisfaction rating. If you plan to have a new go at it, ask advise on Discord first how to write a proper description.

  • Default User Avatar

    To be honest for x, x, x I had no idea what is better to put except for 1, 1.

    For other cases I think I'll put condition in description that concentrations are from 1 ot 100%.

    Random tests are honestly generated by random function :) But I got your point.

  • Custom User Avatar

    Soem edge cases are not tested properly:

    • x, x, x has more than one correct solution and it's not spec'd which should ne returned. .
    • x, 0, x and 0, x, x are not tested, but can trip up some solutions.
    • 0, 0, 0, [x, y, 0] and 0, 0, x can trip up some solutions.
    • The "100 random tests" is a lie :) the tests are not random, but pregenerated and hardcoded.
  • Custom User Avatar

    For this kata you need to calculate mix ratio for two solutions in the form (a, b)

    To me it's not clear what a and b are supposed to mean. The description should mention something like a times first + b times second results in a ratio of z, if that is what is requested.

  • Custom User Avatar

    It's a common (?) chemistry formula for mixing solutions. TBH the task was easy to understand for me, but maybe it's just because I already know the problem?

  • Loading more items...