Skip to content

Latest commit

 

History

History
11 lines (8 loc) · 302 Bytes

File metadata and controls

11 lines (8 loc) · 302 Bytes

Problem 8: Non-Adjacent Sequence

Problem Statement

Given a string s, rearrange the characters of s so that any two adjacent characters are not the same. If it is not possible, return the empty string "".

Input Format

  • A string s.

Example

Input: s = "aab"
Output: "aba"