Ad
  • Custom User Avatar

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

  • Custom User Avatar

    My code doesn't pass test 4, 7, 8, 9, 11, 12, 13, 14. The first error is: "Expected: Leonard, instead got: Penny". This seem to happen due to the names array input stacking up all the names as a global variable. I then tried to declare a copy of it to a new variable, and refer to that copy while running my function. Same problem persist. Finally - I made a raw copy of the names array and put it in my code. It now passes all the tests, but instead I'm getting an error saying "Process was terminated. It took longer than 6000ms to complete". Can someone please help me explain what's going on?

    I'm using JavaScript.

    Thanks in advance!