XOR Strings 3

Sort by

recency

|

92 Discussions

|

  • + 0 comments

    Still broken in Ruby (no starter code)

  • + 0 comments

    For the java version.. only thing that make the exercise work is convert to Java 7 and you found all the function you need to modified.... please fix that for Java 8 and Java 15....

  • + 0 comments

    Solved using python

    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()
    t = input()
    print(strings_xor(s, t))
    
  • + 0 comments

    Hi Guys, please use JAVA 7 as env. It is working. In java 7 we have code already it is dubugging problem just need to change 3 things in the code given.

  • + 0 comments

    The problem specify debug the code, but for JavaScript, there is no code. Here my solution for JavaScript, not working despite solution is correct 🤷‍♂️ (I guess is because it does not have anything to compare lol)

    process.stdin.resume();
    process.stdin.setEncoding("ascii");
    var input = "";
    process.stdin.on("data", function (chunk) {
        input += chunk;
    });
    process.stdin.on("end", function () {
        // now we can read/parse input
        const [s, t] = input.split("\n")
        let res = ""
    
        for (let i = 0; i < s.length; i++)
            res += +(s[i] !== t[i])
    
        console.log(res)
    });