THe sample cases give correct answer but wrong answer on submitting.
Code:
Wrong answer on spoj
1 Like
THe modified code is:
@rajarshib03
This is the updated code. There were some issues in your code which I have corrected and have also placed comments.
Feel free to revert in case you face any query.
If my answer was able to resolve your query, please mark the doubt as resolved.
1 Like
Thank you, it worked.
In spoj it is being accepted but in coding blocks the last test case is not passing.
@rajarshib03
Check the constraints in the CB Problem. The question might be slightly different.
1 Like
Yes it is working, removed the if-else condition in the solve method.
Thank you.
Welcome! Keep practising.
1 Like
Yes thank you it has been cleared