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.
I apologize for my stupidity. I was so annoyed by my off-by-one error, I couldn't see the simple solution anymore! :-)
Great kata and good test cases!!
Doesn't this solution return a false positive for num1 = 111 and num2 = 22?
This comment is hidden because it contains spoiler information about the solution
Should add the 'using System.Collections.Generic;' to the setup, because the signature already needs it. The setup should compile out of the box imho.
The test class is called StairsTest and has two tests called Test2. The second of the Test2 methods does not have a sharp number, as -1 and 1 both appear 2 times, but the assert expects 1 as the result. Deleting that test allows one to submit.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Your solution will result in a 'System.OverflowException : Arithmetic operation resulted in an overflow.' for n < 0.
I think the if statement is actually wrong as your solution will return null for n <= 0, but the task said to return an empty array for negative numbers.
As a side note, you can change the string.Format to string.Format("#{0:x2}{0:x2}{0:x2}", i).