Ad
  • Custom User Avatar

    Nice kata to exercise pattern matching with.

  • Custom User Avatar

    Oh sure, you're right. It's obvious, I have been fooled by an error in my code. Thanks for answering :)

  • Custom User Avatar

    an arrow has a head, '>' or '<', and optionally a tail, that must be located opposite to where the arrowhead is pointing; so =< is a lone = followed by a leftwards arrow of size 1. It is true that it is not explicitely specified

  • Custom User Avatar

    I am asking this as a question, since I don't know if I have missed something or there is an unclear specification: how should be treated =<=>? Two valid arrows (=< and =>) or a sequence of value 0 (= -> 0 + <=> -> double ended arrow, so 0 two),

  • Custom User Avatar

    Just because you think you covered every case, doesn't mean it's true :P

    You can print input values as shown here https://docs.codewars.com/training/troubleshooting/#print-input (Python example, but printing to console works for every language)

    As it stands, this isn't a kata issue, but a question (until proven otherwise).

  • Custom User Avatar

    That makes more sense. I'll return set()

  • Custom User Avatar

    Changed to return None for no solutions case

  • Custom User Avatar

    Even the fixed tests are incorrect:

    collect_apples([0, 1179, 655, 655, 262, 262, 1048, 655, 393, 1179, 917, 0, 1179, 0, 131, 0, 262, 917, 786, 655, 524, 0, 0, 131, 262, 131], 10)
    
    {(False, True, False, True, False, False, True, False, True, False, True, False, True, False, True, False, False, True, False, True, False, False, False, False, True, False)}
    should equal
    {(False, True, False, True, False, False, True, False, False, True, False, False, True, False, True, False, False, True, False, True, False, False, True, False, True, False),
     (False, True, False, True, False, False, True, False, False, True, False, False, True, False, True, False, False, True, False, True, False, False, False, True, False, True),
     (False, True, False, True, False, False, True, False, False, True, False, False, True, False, True, False, False, True, False, True, False, True, False, False, True, False)}
    

    The expected values sum to 7205, when there is a configuration with a sum of 7336.

  • Custom User Avatar
    test.assert_equals(collect_apples(t3, 9), {})
    

    {} is an empty dict, not an empty set.

    >>> type({})
    <class 'dict'>
    
  • Custom User Avatar

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

  • Custom User Avatar

    Approved!

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

    Thanks! Fixed the tests to use @it decorator and fixed the titles. I also noticed that I was doing 800 assertions per batch, when I wanted it to be 800 in total.

  • Custom User Avatar

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

  • Loading more items...