sol - https://ide.codingblocks.com/s/207230
1 test case fails.
@sudhanshu8917 your code is failing for the following test case
50 true 12 true 18 false false false false
the expected answer is false whereas your code is giving true as output
how to correct it i am not able to get my error.
@sudhanshu8917 try to run your code for the given input, if you are still not able to get your mistake let me know
@sudhanshu8917 you had a small mistake in line 58. if(abs(left.first-right.first)<=1 && left.second && right.second){ change it to this and it will give correct answer now
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.