Ad
  • Custom User Avatar

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

  • Custom User Avatar

    He just outputted the answers directly instead of writing code that would work in all instances. Clearly more tests need to be written.

  • Custom User Avatar

    Thanks for the quick reply. I haven't the foggiest why I would do this, but I must have changed the return and parameter types immediately once I got them into my IDE.

  • Custom User Avatar

    The description says that n is an integer. Long are integers and the given signature of the function is

    public static long maxRot (long n)
    

    Cheers;

  • Custom User Avatar

    I'm getting a Java 43 error stating that there's a possible lossy conversion from Long to Int. The description is pretty clear that the input will be an int, yet the tests accept Long inputs. I can change all of my types in my internal methods and then cast to an Int in the end, but that seems silly. Is this by design or something that made it's way into the Java version by mistake?

  • Custom User Avatar

    Also, it says in the instructions that "Each number will....consist of only the digits 0-9" The unknown number cannot be a negative. -1 should be thought of as Out Of Bounds.

  • Custom User Avatar

    At first I did waste time implementing a swap operation. But then later after looking closely at the test results it became apparent that it was an insert operation. The spec is really not written well as it could have explicitly stated that from the beginning but nevertheless it's not the problem decription that's causing the majority of the heartburn, it's the testing suite and output spec. Ultimatlety I believe there is an issue with the final test somehow but I have yet to confirm that.

  • Custom User Avatar

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

  • Custom User Avatar

    I have the same error with C#
    Did you get an answer to this?

  • Custom User Avatar

    gotcha. Ya, that makes sense. I had to keep setting my count to zero when I was running random tests in VS.
    Thanks a lot.

  • Custom User Avatar

    Don't use global vars, they keep their values between tests, so only the first returned value will be ok, and the next ones wrong.

  • Custom User Avatar

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