Ad
  • Custom User Avatar

    Obviously needs a little polishing, but I like the concept of this one. Of course, I'm someone who adds up the value of the license plate in front of me whenver I'm driving a car, so I'm biased! :)

  • Custom User Avatar

    You are mutating the input array like that, so the next time a test calls your function with a different number the result is wrong.
    Copy and paste your function in repl.it like this:

    arr = ["S", "L", "H", "R", "P"];
    
    def whoIsNext(names, r):
      # your code here
      
    print(arr)
    whoIsNext(arr, 10)
    print(arr)
    
  • Default User Avatar

    Exactly. You're mutating the input. Don't do that.

  • Custom User Avatar

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

  • Custom User Avatar

    You're mutating the input.

  • Default User Avatar

    Thats because there are test cases that have 1000000000 iterations.
    You have to write more 'clever' code.

  • Custom User Avatar

    Infuriating. I have the right answer but I can't submit because of a memory error. Beginning to lose my patience with CodeWars here.

  • Custom User Avatar

    If I run into more katas like this, I'm probably done with CodeWars. It's really unfair to have all the suggested test strings take a particular format (word + number), and only after I've solved for all those to test with random strings that include special characters and jumbled alpha and digit characters. If I had known I needed to solve for strings like this, I would have taken a different approach in the first place. What a waste of time. And if CodeWars will save my work, it's not at all apparent to me how. It seems to me you have to solve these in one sitting, and I'm done with this sitting. Can I not downvote unless I solve? What a shame.