I am having a problem I JS. It all goes smoothly. I always pass like ten random tests, and then one is incorrect. I counted the values of the strings, and my code returned the word with the highest value, and the test code wanted it to return the second largest value.
There is always one "sentence" like this, and the rest works as it should. I know that my code returns the right word because I counted the value of the phrase for multiple attempts by myself as well as logged out what the program counted.
As an example, there is one error massage I've got:
"Testing for "krqrldygsavow arjmlluqyqlqr jsqsuntfthebi dlawvlcmovhaj": expected 'krqrldygsavow' to equal 'arjmlluqyqlqr'"
And this is what my program logged out as the values of the "words": "[ 211, 205, 179, 154 ]"
Edit: Thanks so much! I cannot believe I had such a dumb mistake. I am so sorry I bothered you.
Not a kata issue, that's a problem with your code:
Check that again.
I am having a problem I JS. It all goes smoothly. I always pass like ten random tests, and then one is incorrect. I counted the values of the strings, and my code returned the word with the highest value, and the test code wanted it to return the second largest value.
There is always one "sentence" like this, and the rest works as it should. I know that my code returns the right word because I counted the value of the phrase for multiple attempts by myself as well as logged out what the program counted.
As an example, there is one error massage I've got:
"Testing for "krqrldygsavow arjmlluqyqlqr jsqsuntfthebi dlawvlcmovhaj": expected 'krqrldygsavow' to equal 'arjmlluqyqlqr'"
And this is what my program logged out as the values of the "words": "[ 211, 205, 179, 154 ]"