Shil and Palindrome

getting wrong output
ide: https://ide.codingblocks.com/s/258451

Hello Vishal, your logic seems to be alright but there are certain things you need to take care of. As while updating you need to do bit[index] += val not this bit[index] = val
And when the countoo is <=1 then we can say that we can form the palindrome so at that place you need to return “yes” instead of “no” so pls also make it correct. And one more thing is that you are using bit[26] as an array and but n can be greater than 26 suppose n is 100 and you need to access index 60 so it won’t be possible as your bit size is only 26 so you need to call the constructor to pass the value n.
Please have a look at this the idea is same as yours hope you will easily understand this.

I hope it is clear to you. In case it is clear to you pls mark it as resolve and provide the rating as well as feedback so that we can improve ourselves.
In case there is still some confusion pls let me know, I will surely try to help you out.
Thanks :slight_smile:
Happy Coding !!