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.
This comment is hidden because it contains spoiler information about the solution
a and b are just grid dimensions. It's completely arbitrary which one might represent the number of rows and which one for columns.
It does define x and y in the description.
You only see solutions, if you solved it. (bigcacturne) I see mine - when I click on your reply/View Solution ... it says 'there is no solution to show'
The kata descriptions tend to be the most generic possible, so it's expectable there are some differences between the description and the kata in some particular languages (not all languages have tuples, naming conventions are different...).
Top solutions are just the ones that have been the most voted. Unfortunately, many times, top solutions are far from being best practices.
In the Python version, the test code gives a list of tuples as argument, not a list of lists as in the instructions. Also the function name is different than in the instructions.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Not sure it's worth importing for that single use.
630ms still seems like a long time. My solution is repeatedly under 75ms. I notice that your solution, like many others, creates an extra array. You are also summing the list, then substracting from that sum. Best to work through the list backwards, summing as you go with each iteration. And then just removing the list items that aren't leaders - this makes for less manipulation of the string.
The "Clever" upvote.
I know these test cases were rather small arrays, but I wonder if it is less computationally demanding to declare the flipped array as seperate variable, so as not having to flip it for each loop.
The answer is simple: it does not.
Definitely not best practice.
Loading more items...