Why is this error showing?


I don’t understand the rror being shown here

ANd Please tell Why this is not working?

your code is absolutely fine.
there is some issue while reading input.

the problem is getline() function stops after seeing newline character.
let say input is: 8 abccbabb… your code will read 8 first in n, then abccbabb in s.
now if input is:
8
abccbabb
then your code will read 8 first in n, then ‘\n’ in s. since there is ‘\n’ in input buffer after 8.

solution: you can simply use cin>>s;
OR
call getline() 2 times, in first call it will eat up the new line character.
thanks

Now, It is showing the error
And Please tell error in code 2.

what is the question exactly?please send me the link of the question.
in code 2, you are checking for array of integers to be palindrome.

thanks

With this code, It is passing only 2 test cases. What to do now?

can you please send me the link of problem statement. send me the link, where you are submitting the solution.
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.