Hackerearth: Micro and Sweets

Can anyone pls chk my code for this problem and tell me where am i getting wrong
CODE:https://ideone.com/wXlLIm

PROBLEM:https://www.hackerearth.com/practice/data-structures/arrays/multi-dimensional/practice-problems/algorithm/micro-and-sweet-distribution/

1 Like

Additional Comments : Please try running the code on hackerearth compiler itself. For some unknown reason, its running on codechef etc. but on that compiler, its giving error. Hence, try submitting the solution to confirm if the issue is actually sorted or not.

You forgot to write the arguments expected by the main method. Here is the code that runs: http://ideone.com/EL7VTB

1 Like

You checked running it on hacker-earth compiler? I am happy you helped that guy out, i was not able to trace the error (i felt its somewhere in syntax but couldnt pin-point where- i dont use JAVA thats why :confused: )

Yeah I just checked it. It compiles and print stuff. Yeah I agree, it could be tricky to debug. :slight_smile:

1 Like

Hey @codedecode0111 - Actually that wasnt the problem. If you click on submit button you will get real test cases which are giving you error. The error is - “Exception in thread “main” java.lang.StackOverflowError”

This happens on THAT specific compiler for larger values of co-ords. Hope that makes the Q clearer :slight_smile:

1 Like
//