I am unable to find why I am not passing all the test cases.
Regarding some test cases
Have debugged your code here, just was an issue with if else statement and also of data type. We have to take value of N as long long int instead of int, you can check the code here as itβs giving 100% result.
Oh, I forgot to consider β2β. In some previous code, I used long long as well, but still the cases passed were some. Got the mistake, thanks.
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.