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.
Note that you can start at first or second step. Likewise you can end at last or second to last step. In the order given in the description:
climbing_stairs([0, 2, 2, 1]) ➞ 2
The cheapest route is the first (index-0) and third step (index-2). So 0 + 2 = 2.
An alternative route is the second (index-1) and third step (index-2). So 2 + 2 = 4, but that is more expensive than the first route.
Another alternative route is the second (index-1) and fourth step (index-3). So 2 + 1 = 3, but that is also more expensive than the first route.
climbing_stairs([0, 2, 3, 2]) ➞ 3
The cheapest route is the first (index-0) and third step (index-2). So 0 + 3 = 3.
climbing_stairs([10, 15, 20]) ➞ 15
The cheapest route is the second step (index-1). So the cost is just 15.
climbing_stairs([0, 0, 0, 0, 0, 0]) ➞ 0
Here the cheapest route is any legal route as all "jumps" are free.
Read my reply below to the exact same comment.
This comment is hidden because it contains spoiler information about the solution
1st question: No ridesharing, each pickup and dropoff pair needs 1 taxi.
2nd question: A single batch of requests, the pickup and dropoff times indicate when the taxi should actually be in operation.
Fixed, thanks.
If anyone wants to translate the kata to other languages, I'd be more than happy to approve it.
This comment is hidden because it contains spoiler information about the solution
O(n^2) will not pass, you need to make it more efficient.
It's hard to balance giving you advice and spelling out the solution. But, I will try nonetheless.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Ok, I just did. Thanks again.
They are not. Thank you for looking at my kata and giving me feedback.
You can longer do this as far as I can see.
This has been fixed, your cheating solution no longer works.
Loading more items...