Reorganize String
Given a string s, rearrange the characters of s so that any two adjacent characters are not the same. Return any possible rearrangement of s or return "" if not possible.
Reorganize String

Given a string s, rearrange the characters of s so that any two adjacent characters are not the same. Return any possible rearrangement of s or return "" if not possible.

Example 1:
Input: {"s":"aab"}
Output: "aba"
Input
arr ={"s":"aab"}

Start

Max Heap (Left)

2

1

Min Heap (Right)

Empty

Variables
No variables to display
DepthFunction Call
Stack empty
0/9