Skip to content

Latest commit

 

History

History
12 lines (9 loc) · 381 Bytes

File metadata and controls

12 lines (9 loc) · 381 Bytes

Problem 17: Equidistant Rearrangement

Problem Statement

Given a string s and an integer k, rearrange s such that the same characters are at least distance k from each other. If it is not possible to rearrange the string, return an empty string "".

Input Format

  • A string s.
  • An integer k.

Example

Input: s = "aabbcc", k = 3
Output: "abcabc"