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.
The test is correct; see jmeek's comment above.
I had the same problem with that particular test.... Based on the parameters given, the test appaers to be faulty.
:c
doesn't appear in the first round at all, thus, you may end up not even keeping track of its votes. Thus, you should make sure you count the votes for all candidates even if they don't appear in the first round. Anything not appearing in the first round should be removed, anyway.Apparently, the logic is that your algorithm is supposed to collect the names of all candidates before checking vote totals. Therefore :c would have been eliminated in the first round because :c recieved 0 votes.
Yes, I can imagine I misinterpreted the instructions, but I don't think I did. Others code warriors here think the last test is incorrect.
same to you...
same issue here
Got the same issue, though my elimination technique differs.
Hard to figure out whether or not i misinterpreted the instructions.
Yep, I got the same thing. Faulty test?
[ [ 'a', 'c', 'b', 'd', 'e' ],
[ 'd', 'c', 'a', 'b', 'e' ],
[ 'e', 'b', 'd', 'a', 'c' ],
[ 'e', 'a', 'b', 'c', 'd' ],
[ 'b', 'c', 'e', 'a', 'd' ] ]
a, d, and b are eliminated, and c moves up in each row:
[ [ 'c', 'b', 'd', 'e' ],
[ 'c', 'a', 'b', 'e' ],
[ 'e', 'b', 'd', 'a', 'c' ],
[ 'e', 'a', 'b', 'c', 'd' ],
[ 'c', 'e', 'a', 'd' ] ]
c now has > 50% of the votes, but the test fails with:
Expected: e, instead got: c
Thanks for that Kata. Quite simple, but good to learn this.
Ah, oops! OK, I've amended that test case so it should work both ways. Thank you!
The current solutions were invalidated anyway on the
"should render the leaderboard with a subset of users"
test - theleaderboard
variable still contains all 100 names.Great point, that's a much better way to do it! I've updated the example test cases and test cases to use your suggested tests. I've also kept the leaderboard array preloaded so current solutions won't be invalidated, but hopefully people will use your way going forward. Thank you! =)
Thank you for the feedback! I've updated the comments so hopefully they're a little more clear now.
Oops! Maybe I was thinking that I want you to also desire making the anchor tag. More likely I should just proofread better =). Thanks!
Loading more items...