Ad
  • Custom User Avatar

    I still don't understand why mutating or not the input would be relevant to this.
    My first answer mutate the input, returned the right answer and I was getting “Value is not what was expected”. That's fine, but if I hardcode the return to the right answer it works, and the input is being mutated all the same.
    I even console.log a test to see if the result coming from the algorithm and the hardcoded version are the same, and they are, but only the hardcoded version is accepted as correct. Would anyone be bothered to explain why?

  • Custom User Avatar

    Yeah, my first solution for rad was along those lines. I struggled for a bit to understand what part of the code was causing the stack to blow, I was actually surprised it was there. I ended up using (ew) for loops.
    Do you know why that happens?