• + 2 comments

    large amount of lines will crash your solution. And map fucntion need to make Boxing methinks and this takes much time

    • + 0 comments

      WTF!!! It's true! I had a time out problem with test case 7 up to 12 I think and my code is good enough and didn't know what to do...until I read your comment, I removed all the empty spaces and the debugging prints (System.out.println for Java 8) and it worked :O LOL thanks.

    • + 1 comment

      This is true, I spent too much time trying figure out why my solution was timing out. Deleted some whitespace and it ran fine.

      • + 0 comments

        Hi,

        I have uploaded a video tutorial which can help you to understand the problem as well as logic.

        Here is the video tutorial for my solution O(n+m) complexity.

        https://youtu.be/hDhf04AJIRs

        Would really appreciate your feedback like, dislike , comment etc. on my video.