Tap here to switch tabs
Problem
Submissions

Problem: Maximum Bitwise XOR After Rearrangement

Maximum Bitwise XOR After Rearrangement gives two equal-length binary strings. Rearrange the second string in any order and return the binary string produced by the largest possible bitwise XOR.

Statement

You are given two binary strings s and t of equal length.

You can rearrange the characters of t in any order.

Return a binary string representing the maximum possible bitwise XOR result between s and any rearrangement of t.

Constraints:

  • 1≤n==1 \leq n == s.length ==== t.length ≤2×105\leq 2 \times 10^5

  • s[i] and t[i] are either '0' or '1'.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Maximum Bitwise XOR After Rearrangement

Maximum Bitwise XOR After Rearrangement gives two equal-length binary strings. Rearrange the second string in any order and return the binary string produced by the largest possible bitwise XOR.

Statement

You are given two binary strings s and t of equal length.

You can rearrange the characters of t in any order.

Return a binary string representing the maximum possible bitwise XOR result between s and any rearrangement of t.

Constraints:

  • 1≤n==1 \leq n == s.length ==== t.length ≤2×105\leq 2 \times 10^5

  • s[i] and t[i] are either '0' or '1'.