Ad
  • Custom User Avatar

    when it seems you are doing the right thing and tests says no.
    then you make such hard code

    def sort_by_bit(arr):
        return [1, 2, 3, 4, 5, 6]
    

    and the tests say that they don't care what you return.

  • Custom User Avatar
  • Custom User Avatar
  • Custom User Avatar

    Python translation

    I don't know if it is possible in python not to create an instance of the class or the class itself to be able to address its attributes.

    therefore, you have to make the NumClass itself, and in the tests create instance Num = NumClass(), on which the tests are made.

    It is also possible to discuss the need to implement dunder methods for comparison (equality), arithmetic. because it wasn't in the original kata.

  • Custom User Avatar

    wow!
    I upvoted this as best pratices, but not because I think it's a best practice, but so that more people will see it.

  • Custom User Avatar
    ([2, 2],  0) False should equal True```
    
    I thought that the condition says about non-empty subsequences, both "in the center" and on the edges. Wierd.
    
  • Custom User Avatar

    Double check your code.
    I had false answer for this case too. Only because I compare correct addendums of checksum I found typo error in my code.

                     0   4   8   6   6   5   0   8   8    X
    position      x  1   2   3   4   5   6   7   8   9   10
    addendums are = [0,  8, 24, 24, 30, 30,  0, 64, 72, 100] 
    the sum is 352  = 11*  35
    
  • Default User Avatar

    author here. the description states "... but NOT 23:21:19", showing that the sequence must not be decreasing. It might have been confusing however, so I've altered the description. How's this?

  • Custom User Avatar

    I spent some time to detect both growing (increasing) and falling (descending) arithmetic progressions to comply with the rule 1.
    But then spent more time to understand what needs to be detected only increasing (growing) arithmetic progression.

  • Custom User Avatar

    When I looked at the name of this kata, I thought that I would have to calculate the difference between bit arrays, not whole characters.

  • Custom User Avatar

    I think that the tests should have cases where the initial shift has such a value (near 26), that if you add the number of words, the result exceeds 26.

  • Custom User Avatar

    python random tests have \n endings, sample tests doesn`t.

  • Custom User Avatar

    Unfortunately, rejected due to fork superceded by saudiGuy fork

  • Custom User Avatar

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

  • Custom User Avatar

    Author's python solution assume that arguments from diapason 84600 - 86399 (23 hours 30 minutes 00 seconds - 23 hours 59 minutes 59 seconds) must to return '0 days ago'

  • Loading more items...