Zig Zag Sequence

  • + 2 comments

    Strange problem! I coded a solution in Java 15. I ran my solution in IntelliJ IDE and I am getting the expected output printing to the console. So it is working correctly in the IDE.

    But, when I run the same code in HackerRank, it doesn't work at all. All test cases fail.

    Is this problem broken?

    (PS: regarding the rules about modifying 3 lines in the given code. There is absolutely no given code inside the main function when using Java 15. So I wrote my solution from scratch.)