Ad
  • Custom User Avatar

    You're welcome. I've also edited my posts accordingly.

  • Custom User Avatar

    Yes, you are correct, I had misinterpreted the test results and misread that aspect of the instructions. Apologies if I waylaid anyone and thanks for catching it.

  • Custom User Avatar

    I'd say 78901 isn't, but that's right, 7891 isn't incrementing either. No problem, next time someone will think 109 isn't right, hopefully will read this and realize it's ok.

  • Custom User Avatar

    I see now - incrementing sequences can END in a zero but it can't wrap around.

    I would edit this issue but I don't think I can once marked solved.

    So 7890 is interesting but 7891 isn't.

  • Custom User Avatar

    In case 109 is the test which his code is failing:

    For incrementing sequences, 0 should come after 9, and not before 1, as in 7890.

    See this note, 67890 is incrementing, 67888 is upcoming incrementing, both tests are ok.

    109 isn't decrementing, because of the other note:

    For decrementing sequences, 0 should come after 1, and not before 9, as in 3210.

    it can't be decrementing by definition.

  • Custom User Avatar

    Edit - ok, i'm seeing it more clearly... it doesn't wrap around but it can end it zero .I'll edit my response

  • Custom User Avatar

    Edit - Without more information from OliverS-K we can't conclude 109 is the case his code is failing, but that's a possibility.

  • Custom User Avatar

    Edit -

    My response here was incorrect as per the instructions. 109 should not be considered interesting because decrementing sequences shouldn't wrap around.

  • Custom User Avatar

    No, it's not and it's been already discussed before.

    For decrementing sequences, 0 should come after 1, and not before 9, as in 3210.

    For incrementing sequences, 0 should come after 9, and not before 1, as in 7890

    There is no wrap around:

    Input will always be an integer greater than 0, and less than 1,000,000,000.

  • Custom User Avatar

    Both 7473747 and 1221 are palindromes - what's the issue?

  • Custom User Avatar

    I don't know what the 11209 one was, but 99 should return 1 because 99+1 == 100, an interesting number.

  • 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

    Done in Java. Only thing that slowed me down was merging the minor array in an efficient way. Used the Arrays utility to do it, but I suppose I could have iterated it better from the get-go.

    Is there a more efficient way to do it than recursion?