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.
Test cases like
computing n^kandcompute factorialdoes not check whether solution handles invalid cases by throwing error first before actually try doing the calculation with try-except. Also, there are better ways to test this behavior than using try-except.It's not a performance issue you're having. Try throwing error when there are invalid case (
len(stack) <= 2for example). This is an issue with the test case.The author asks you to find the maximum sum of contiguous subsequence in a list, not to generate all possible contiguous subsequence and find the max sum between all those generations.
Both leads to the same conclusion, yes. But what is required to complete the task can differ.
Ask yourself, if you want to calculate the sum of 1 million 3s, do you make a loop that will add to a variable 1 million times? That would be slow, instead we can just do
1_000_000 * 3. The same logic can be applied here. You just need to find the same result using a different and faster algorithm.My suggestion would be to just skip the kata if you don't know how to solve this yet, you can come back later.
In
Tasksection:Folder should be
filesnotfileI vote for 5kyu + Voile's suggestion.
Based on the rank assessment votes, this shouldn't be approved at 4kyu.
Votes: https://www.codewars.com/api/v1/code-challenges/5fe399429f548e0023d5c816/assessed-ranks
Expected result in tests differs from the description.
From the description: A tuple containing 2 items. The count of unique combinations and the actual combinations
In tests: Only the actual combinations
This is not true for the
k=1testNo random tests
Tests expect that
Qis not excluded. So, this statement is not true.Last random tests
describeblock has wrong name (Should beLarge/BignotSmall).:)
Yup, it's fixed.
In the tests:
I suggest changing the code into something more readable, as it won't only be you maintaining the code once this gets published.
The moves in javascript can lead to positions outside of the tape:
The message
2 should equal 1refers to a previous test your code fails on:As you can see above, your code returns
2for input00101.No, both should be 2. Are you sure that's the candles the tests gave?
Loading more items...