Ad
  • Default User Avatar

    I was failing at the same test. Try to figure out how your function behave when you pass boolean values as input

  • Custom User Avatar

    Well, to answer your original question, that seems a good idea (though it may depend on the language you use, which makes it more or less difficult), and that's how I personnally solved this kata in several languages (but in others I did it only parsing the array, and not destructuring it, which is a better and more instructive practice, IMO). Now, it's easy to get lost and/or do something bad so that it eventually doesn't work. Hard to help you without knowing more. You should consider carefully the tests that fail, print stuff to check the progress of your output... In one word: debug it.

  • Custom User Avatar

    Use spoiler flag next time.