• + 0 comments

    title: Debugged and Reliable Python Solution for XOR Strings Body: Hi everyone! 👋

    I faced an issue where the same code sometimes failed hidden test cases and then passed on retry.(reset your page)
    Here’s a clean and robust Python solution for the XOR Strings problem:

    Python Code

    def strings_xor(s, t): res = "" for i in range(len(s)): if s[i] == t[i]: res += '0' else: res += '1' return res

    s = input().strip() t = input().strip() print(strings_xor(s, t))

    How it works:

    1. Compare characters of both strings one by one.
    2. If characters are the same → add '0' to the result.
    3. If characters are different → add '1' to the result.
    4. .strip() ensures no extra spaces cause wrong answers.
    5. Return the final XOR string.

    ✅ This method handles hidden test cases reliably and avoids common issues like extra spaces, leftover debug prints, or newline mismatches.