Ad
  • Custom User Avatar

    Kata like this is a duplicate to many existing katas nowadays.

  • Default User Avatar

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

  • Custom User Avatar

    Do not use leading zeros so [1,2,3,0,2,3] should return 2: 123 - 0 - 23 and 123 + 0 - 23 but NOT 123 - 023.

    Random tests never randomize 0, so this case is not tested. My solution hardcodes one fixed variant and does not care about leading zeros and still passes.

  • Custom User Avatar

    What's the maximum lenght of the input array? Is there a limit on it?

  • Custom User Avatar
    • Suspiciously similar to existing katas, but rather not strictly a duplicate.
    • Wouldn't it be nice to forbid eval right away and just accept 'proper' calculations?
    • Is it allowed to reorder array elements?
    • Is it allowed to merge more than two consecutive numbers? Is it allowed to merge leading zeros? Is following a correct combination: ([1,2,3,0,2,3], 100) => 123-023=100?
  • Custom User Avatar

    This kata needs random tests ;-)

  • Custom User Avatar

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