Runtime in some test cases
Your solution is not passing because of the Exception in thread βmainβ java.lang.OutOfMemoryError: Java heap space at Main.(Main.java:3).
You may either create a single 1-D array to solve this problem or create a runnable thread and increase your heap size.
Oh , Thanks you sir