I am traversing each node only once in my code and have also taken care of stopping the search when the current sum becomes greater than required sum but then also I am getting StackOverflowError for perf test case 21
Dude to the limitation of the JAVA compiler used you are getting a StackOverflowError. We are working on this issue. Sorry for the inconvenience.
Closing this topic as your issue is resolved by the mentor. If it is still not resolved, Kindly un-mark the accepted solution or create a new topic and post this question as a reference link in the description of the new topic.