Ad
  • Custom User Avatar

    It's not a reversed number, it's a number with its digits rearranged.

  • Default User Avatar

    Maybe 1210 instead of 1021, send the 0s to the end perhaps. If I understood correctly, the reversed number should be the largest possible...?

  • Default User Avatar
  • Custom User Avatar
  • Default User Avatar

    The output should be int.

  • Default User Avatar

    Anyone who has solved the kata can see your code if you post in discourse. This kata is almost 8 years old and has over 64k solves in javascript. The chance that someone will find a bug in the kata at this point is extremely small (but not impossible, I guess). In this case, it's pretty simple to look at the test cases and see what the test actually expects your function to return.

  • Custom User Avatar

    No, it's the other way around, and you can convert one into the other, why do you say you can't?

  • Default User Avatar

    there are problems with test#4 and test#5
    2110 cannot be converted into 1021
    and 987654321 into 123495678

    @Test
    public void test_04() {
        assertEquals(2110, DescendingOrder.sortDesc(1021));
    }
    
    @Test
    public void test_05() {
        assertEquals(987654321, DescendingOrder.sortDesc(123495678));
    }