isPalindrome Problem

problem: https://online.codingblocks.com/player/7730/content/4913?s=1584
soln: https://ide.codingblocks.com/#/s/32847

can you help me with this ?
this code is accepting few cases only and i m not able to figure out the error

@Kanika-Gupta-3500762 the linkof question is not opening otherwise check this
https://ide.codingblocks.com/#/s/32892

https://hack.codingblocks.com/contests/c/509/371 — here is the link of question
https://ide.codingblocks.com/s/32847 ---- and this is my solution which is not passing few test cases

also the link of solution you mentioned is still not working only half the test cases are passed

You have taken input in form of character. So if input is something like this:
Input:
4
1
21
21
1
Your code will fail to except 2 characters 21 together and may give wrong result.

So instead of taking char array, use int array.

i made these required changes and still its same
2 cases are still wrong

Please add the code.

https://ide.codingblocks.com/s/33672
here is the code link
it is now printing true for every case and i dnt know why

1 Like

@kanika check this
https://ide.codingblocks.com/s/33747

it is giving true because the i u are passing from the main function to the function has the value n not 0
see uy line no 30 here i is incremented upto n because i is not local to that loop pass 0 instead of i in the function

ohk thnku now i understood the mistake