Ad
  • Custom User Avatar

    You're making a function that will be called a number of times. All your code should (in 99% of cases) be contained inside this function. Any global variables retain state between calls.

  • Default User Avatar

    You shouldn't use input on Codewars in general. A number will be fed to your function in the tests. Just assume that function will receive the necessary parameters to execute without having the user entering any kind of number. Hope this helps! If you reset your solution, you should use "n" as the number who will be necessary to code your solution.