Ad
  • Custom User Avatar

    this would fail this test

    assertEquals(
    "apples, pears# and bananas\ngrapes\nbananas",
    StripComments.stripComments( "apples, pears# and bananas\ngrapes\nbananas !$apples", new String[] { "#$", "!$" } )
    );

  • Custom User Avatar

    The author has provided a function, MorseCode.get(), to retrieve the codes, but if you provide a code that function doesn't know it returns null.

  • Custom User Avatar

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

  • Custom User Avatar

    Long story short, you shouldn't modify given function signatures :P If you remove throws Exception, then it should work.

    the requirements are "non-negative integer"

    This simply means you will only receive non-negative numbers in tests, and you shouldn't have to worry about other inputs. It should also be safe to assume that numbers won't go past integer's bounds, otherwise that would be a kata issue.

  • Custom User Avatar

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

  • Custom User Avatar

    Issue with your code is not the same as KATA issue :/ Java has 8000+ completions, so I'm pretty sure the tests are fine.

    I'm not really familiar with that error message, but maybe you're trying to throw an error where it's not needed? No try-catch blocks should be needed here, as all inputs should be valid.

    If you can't resolve it, try posting your code here, format it properly and mark it as spoiler.

  • Custom User Avatar

    Closing.

  • Custom User Avatar

    When summit my solution I get 4 messages like:

    ./src/test/java/DescendingOrderTest.java:9: error: unreported exception Exception; must be caught or declared to be thrown
    assertEquals(0, DescendingOrder.sortDesc(0));

    But in my tests, I test for this very same case plus:

    		assertEquals(0, DescendingOrder.sortDesc(0));
    		assertEquals(2111111111, DescendingOrder.sortDesc(1111111112));
    		assertEquals(54421, DescendingOrder.sortDesc(21445));
    		assertEquals(654321, DescendingOrder.sortDesc(145263));
    		assertEquals(987654321, DescendingOrder.sortDesc(123456789));
    

    and they all pass. ????

    Any tips? Please .....