XOR Strings 2

Sort by

recency

|

241 Discussions

|

  • + 0 comments

    Python solution

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

    There is no 'strings_xor' function in the 'Javascript (Node.js)' mode. Is this a bug? What should I debug in corresponing to the test conditions?

    • + 1 comment

      In Java mode, guys must switch only to version 7. Similarly in other languages try to swith to earlier versions.

      • + 0 comments

        Thank you for getting back to me. I just completed the task in C++ ))

  • + 0 comments

    For Python:

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

    For C++, it looks like the submission process is broken for modes C++14/C++20.

    Those modes gave wrong answer for code that was successully submitted in C++11 mode!

    • + 0 comments

      Yes. I too faced exactly the same issue.