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
This comment is hidden because it contains spoiler information about the solution
I'm still very new to to time complexities, so I apologize if this is wrong, but when you say O(N^3) do you mean O(N * M^2) where N = number of customers and M = number of queues? In that case things wouldn't be too bad as long as we can assume that there aren't too many queues, right?
This comment is hidden because it contains spoiler information about the solution
Agreed. It would be awesome if we could see which languages we've completed a kata in at a glance – ideally from the main list.
This comment is hidden because it contains spoiler information about the solution
@KenKamau: I understand. Don't get me wrong, this wasn't meant as criticism, just as a fun little observation in case other users wondered if and how the two top voted solutions differed.
@Unnammed: My comment was based on the following timeit results (first fct is sum(arr1+arr2):
So as you can see the performance difference is very small, but it's there. My best guess is that's caused by the additional function call which to my knowledge can be pretty expensive in Python.
This comment is hidden because it contains spoiler information about the solution
Nice one! Though instead of checking
if len(res) == 0
you could also checkif res
.Or, even simpler:
out.append(res or i)
Working perfectly now. Thanks!
Really liked this kata.
However,
isLeapYear
seems to be missing in the test suite of the python implementation and raises an error.