Ad
  • Default 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

    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

    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.