Output in char input in int

prob: https://hack.codingblocks.com/app/contests/1975/170/problem

sol: https://ide.codingblocks.com/s/381730

I know my implementation is wrong but i have tried to attempt it in a way one would do if the output was also char

Hello @raghav007 in this question you have to simply take the xor of the digits i.e if the digits are same of the number then the output will be zero but if the digits are different then output will be 1.
Try to implement in that way.
Happy Learning!!

ohh okay but how do I store zero in leading positons as is required by the question

No nothing like this is required. It just like you have to perform the operation on every digit of a number. I will recommend you to take this number as string then run the for loop and perform operations on number of the string.

updated sol: https://ide.codingblocks.com/s/381807
I have tried

correct updated: https://ide.codingblocks.com/s/381807
pls ignore other one

it should output 00111 but not showing the zeros

Why are you multiplying with power.
There is no need of this.
See don’t multiply xor with power where you are taking xor after taking xor just try to cout every xor result there.
You will find that your output will be reverse of the given output then you have to do that only.

yeah I tried it is the reverse of orignal number but when I reverse it again won’t it omit the leading zeros

Just try to reverse that by storing them in vector and reverse the vector.