• There is an inconsistency in what the expected results are for function arguments in the analysis of subclasses.
    For bound methods, it appears that only an argument exactly called self should be excluded, whereas for class methods, it is always the first argument, whatever it may be called, that should be excluded.
    From the tests:

    body: {
      'md1': lambda x: 'md1',
      '_A__md2': lambda x, y: 
      'md2','md5': classmethod(lambda cls, x: 'md5'),
      'md6': classmethod(lambda var1, *vs: 'whoops')
    }
    

    Expected results:

    [('md1', ('x',), False, False, False), 
     ('md2', ('x', 'y'),
     ('md5', ('x',), False, True, False),
     ('md6', ('vs',), False, True, False)]
    

    The lambdas for md1 and md2 are really bound methods, but instead of self the first parameter is called x. But they still show up in the expected results. Whereas in md5 and md6 the parameters cls and var1 respectively are omitted, even if the latter isn't called cls.

    Did I overlook something in the description? If not, then I think this is confusing (and bad) implementation. Either the name of the first parameter is irrelevant, or it is, but not both.

    On a side note, what we are logging here are not arguments, as those are what we call the values supplied in the function call. Here, in the definition, they are parameters. </pedantism>

  • Hurts my eyes to look at

  • The author cares ;-/ Anyway, it's bad luck that the duplicate of an original kata got approved.

  • This JS solution shows that it is possible to solve the kata in a probably unanticipated way.

    It would be possible to craft a test to make it fail.

    If you need more information, feel free to ask.

  • Do you mean list.index()?

    Maybe you don't know what is Time complexity ~

  • 20 lines instead of 1. good typing practice

  • "natural order" is that means "dictionary order"?
    like "abcd" < "accd" , the first diff-letter "b" < "c"

    after solve it, my guess is right~

    ^_^ Nice kata to practice emmmmm~, can't say here~

  • ( JS )

    • Your solution must pass in lss than ref.solution-10ms speed.

    That's actually + 10 ms. ( Also, "less" :P )

  • The array is already sorted!!!!!

  • But sorting an array also requires performance overhead. This is clearly not the case when you need to do extra body movements.

  • There is a manner to find the index of a unique item in a sorted array which is way faster than looping through the entire array.

  • Sorry, but i didn't undersatand you. In task i must be only find default word, right?

  • You must take advantage of the fact that the array is sorted...

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

  • Loading more items...