Issue with logic interpretation

Test cases 1 and 2 not working. Please check where am I going wrong?

@siddhu28.ss hi siddarth ,i have gone through your code, but was not able to find mistake in your logic, so i am providing you my solution,

That soln is amazing, I’ll approach to writing such efficient solns . Please tell me the test cases of the problem so that I can dry run on my code.

THat is your homework. It will improve your thinking ability for tougher problems.

1 Like