2546. Apply Bitwise Operations to Make Strings Equal¶ Time: $O(n)$ Space: $O(1)$ C++JavaPython 1 2 3 4 5 6class Solution { public: bool makeStringsEqual(string s, string target) { return (s.find('1') != string::npos) == (target.find('1') != string::npos); } }; 1 2 3 4 5class Solution { public boolean makeStringsEqual(String s, String target) { return s.contains("1") == target.contains("1"); } } 1 2 3class Solution: def makeStringsEqual(self, s: str, target: str) -> bool: return ('1' in s) == ('1' in target)