for the Problem 1849C
The SOLUTION I wrote, it is having some out of bounds error in the below code portion.
s += (char)('0' ^ '1' ^ s.back());
s = ("" + (char)('0' ^ '1' ^ s[0])) + s; // this line giving error 'out of bounds' though working fine in LOCAL
n = s.size();
I am not able detect the exact reason.
Same purpose If I try to do like below, its not throwing any error
// working as expected
if (s.size() > 0) s += (char)('0' ^ '1' ^ s.back());
reverse(all(s));
if (s.size() > 0) s += (char)('0' ^ '1' ^ s.back());
reverse(all(s));
n = s.size();