You are given two s and target, both of length n. You can perform the following operation on s any number of times:
Choose two distinct indices i and j such that i, j i j. Simultaneously replace s[i] with (s[i] OR s[j]) and s[j] with (s[i] XOR s[j]).
Return true if it is possible to make the string s equal to target, or false otherwise.
Constraints:
n s.length target.length
n
s and target consist of only the digits
You are given two s and target, both of length n. You can perform the following operation on s any number of times:
Choose two distinct indices i and j such that i, j i j. Simultaneously replace s[i] with (s[i] OR s[j]) and s[j] with (s[i] XOR s[j]).
Return true if it is possible to make the string s equal to target, or false otherwise.
Constraints:
n s.length target.length
n
s and target consist of only the digits