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.
Your code does not consider person with 0 votes (i.e, not in the first element of each rows combined). They have the least votes and should be removed first, followed by those who have the least votes amongst the voted candidates.
because n starts from 1 not from 0 like your array
From what I can see it should pass a few tests. However there are test cases that will use very high int numbers for
r
. Including 1,000,000,000. So eventually your code would end up taking too long to run to pass all the tests, or causenames
to get too large for memory. There is a mathmatical way to figure it out that will run quickly enough to pass all the tests.You can format your code using markdown. Add ``` to the beginning and end of code.
Regarding the "Language undefined is not supported" message, I can elicit that response by pasting in a URL to a kata and trying to submit a solution prior to logging in and selecting a language.
Make sure you've logged in to codewars and selected a language before trying to solve a kata.
Hi,
The problem is at this part :
del signature[1,2]
there are never,
in slicing notations, so you should usedel signature[1:2]
(I'm guessing you want to return only the first element). Note that your first seven statements could be reduce to 1 line, in python. ;)Enjoy python !
PS : note that there might be some other errors too, I just indicated the notation problem.