Ad
  • Custom User Avatar

    My appoligies, this is a mistake I made in the Initial Solution.

    The method signature should read:

    func allNonConsecutive (_ arr: [Int]) -> [(Int, Int)] {  
    

    (Note the underscore before arr)

    This is because the tests expect a function with an un-named argument but the Initial Solution names it arr. I've updated the Kata for future takers's but you'll have to either reset your code or update it yourself.

  • Custom User Avatar

    It's not the wrong place, it was the wrong label only ;)
    Check what's printed in the second sample test.

     Log
    [0, 0, 0, 0, 0, 1, 0]
    [0, 1, 1, 1, 1, 0, 0]
    

    Are those the right values?

  • Custom User Avatar

    For problems with your code, use Question label, not Issue, that's for problems with the kata itself. Print your vars goodRacesCount and evilRacesCount you'll see the problem.