3992. Rearrange String to Avoid Character Pair
You are given a string
sand two distinct lowercase English lettersxandy.Rearrange the characters of
sto construct a new stringtsuch that:
tis a permutation ofs.- Every occurrence of
yappears before every occurrence ofxint.Return any valid string
t.
1 | class Solution { |