Ad
  • Custom User Avatar

    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!!

  • Custom User Avatar

    Doesn't this solution return a false positive for num1 = 111 and num2 = 22?

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    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.

  • Custom User Avatar

    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.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Your solution will result in a 'System.OverflowException : Arithmetic operation resulted in an overflow.' for n < 0.

  • Custom User Avatar

    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).