Hi and no problem changing the code
The following is indeed not needed:
(xc == oc ? true : false);
The loop tests strings from both sides to be more performant. Try doing benchmarks of both versions and post the results. I don't have time right now but might do it in the evening and show you the difference. Or, I might just embarrass myself lol.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.