Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Definitely a nice kata. Praise debuggers for existing
Rounding issues should be fixed with this kata. The user is not provided feedback on the training set used in testing. It should show expected as well as user answer, now only showing expected
Anyone stumbling upon the same problem: use Math.round(J * 1000) / 1000 for rounding to 3 decimals, not toFixed(3)
Kek
Oh I see, got ya. Was overthinking it.
Bugged. Does not check for the last requirement, which checks which pair comes first.
For instance in myList = [1,4,6,0,2,7,8,3,5] Should return 3,5 instead of 6,2 for target 8, yet with a lot of peoples' code and my code it returns 6,2 which is regarded as correct. Just putting it out there because I spent significant time trying to figure out how to check for index distances between pairs whilst it wasn't needed.
Thanks for your reply, adjusted my code a little after thinking it through a bit and got it right this time. Sorry again for the dumb question.
This comment is hidden because it contains spoiler information about the solution