• + 2 comments

    I don't know why this solution causes runtime exception...? Did this happen to someone else ?

    • + 1 comment

      Have you figured it out? Can you post your code? Both versions of the solution above work.

      • [deleted]
        + 1 comment
        [deleted]
        • + 0 comments

          Thanks a lot

    • + 0 comments

      Hi,

      I got this runtime exception as well. For me, it was for the Test Case #1 where they have an input of just 0 for one of there queries. Normally, it is a number for the # of nodes in the linked list followed by a set of numbers that need to be reversely printed.

      You can test it out by using custom input of the Test Case #1 input and removing the 0 from the input data and changing the first 5 to 4 queries after.