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.
thanks
I don't understantd your answer, In my case, Matthew and Elizabeth get the same score, so it's Elizabeth's win because E is comming before M.
In the next example, you have the same case :
rank("Aubrey,Olivai,Abigail,Chloe,Andrew,Elizabeth", [3, 1, 4, 4, 3, 2], 4), "Abigail"), Abigail and Chloe get the same score and it's Abigail's win.
There is something that I don't understand.
EDIT : I'm a stupid monkey, I got it, sorry for my useless comment
If you're talking about this test case →
rank("Elijah,Chloe,Elizabeth,Matthew,Natalie,Jayden", [1, 3, 5, 5, 3, 6], 2), "Matthew")
Elizabeth is indeed before Matthew but the test asks for the one in 2nd place. Hence, Matthew is the correct answer.
You're right E comes before I. Here are the results of the test case you provided, sorted →
[ 'Michael', 348 ] [ 'Robert', 336 ] [ 'Ethan', 318 ] [ 'Lily', 310 ] [ 'Benjamin', 304 ] [ 'Emily', 207 ] [ 'Isabella', 207 ] [ 'Aiden', 190 ] [ 'Logan', 162 ] ....
Isabella is the one in 7th place so the test works just fine.
Maybe you got something else wrong.
have you solved that issue? what is the other things to consider? in description it says that we should sort alphabetically nothing more
I have a question about last step, it says that if there is two names with same score, we should sort it by there first name,
in case Matthew and Elizabeth, test case says that Matthew is the output, but why? E is coming first not M, and output
should be Elizabeth, who can explain it?