← All problemsSign in

3849. Maximum Bitwise XOR After Rearrangement

LeetCodeStringGreedyBit ManipulationOpen on judge ↗

You are given two binary strings s and t​​​​​​​, each of length n. You may rearrange the characters of t in any order, but s must remain unchanged. Return a binary string of length n representing the maximum integer value obtainable by taking the bitwise XOR of s and rearranged t. Example 1: Input: s = "101", t = "011" Output: "110" Explanation: - One optimal rearrangement of t is "011".

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start