The random test cases for PHP are messed up -- they don't seem to be able to handle strings that should start with a SPACE or a ZERO
My code is not changing the array "trips". Its specific. I have run the console and I can see that "trips" is getting changed. Hmmmm --
In your code you effectively change the input array trips. You can find that out if you do a console.log(trips) just before you return your result. If you don't change the input array, your answer will be accepted.
Instructions are not clear on WHEN a letter can change case. The uppercase and lowercase letters are a contiguous set for positioning purposes -- they are NOT seperate.
The problem is NOT resolved. I edited my code so that case would return true or false depending on an extra line I inserted. THAT SAME CASE fails both on returning true or false.
I agree the test data for PHP appears broken, in the given example above there is no element in array1 that when squared equals 36100 -- which is an element of array2.
Then the problem must be with whoever made the JS translation??
I can reproduce your error, with the code I get from your post (view solution option). However submitting another solution with a wrong answer (right answer + 1) cleanly receives the error:
Random test #1
[ [ 63, 82 ],
[ 261, 277 ],
[ 251, 278 ],
[ 193, 205 ],
[ 17, 50 ],
[ 226, 262 ] ]
Expected: 120, instead got: 121
Completed in 3ms
I am not an expert in JS and I have no clue what goes wrong.
Changed to "No, I am your father". It's been a while since I watched the old trilogy for the last time. Thanks for positive feedback :)
The quote from EpisodeV is messed up. It is NOT "I am your father, Luke."
It could be "Luke... I am your father"
Or more accurately "No, I am your father"
I hate to be a pain, but really, it's one of the most iconic lines in cinema to date.
This is programming after all, and being "technically correct" is the best kind of correct.
Otherwise great Kata.
(I had too, I happened to be watching the film when I was completing this. No sh!t)
Hey friendo :D Nice answer ;)
The issue is still not resolved. I kept getting odd numbers looking for "true" as a result.