Skip to content

Latest commit

 

History

History
11 lines (8 loc) · 352 Bytes

File metadata and controls

11 lines (8 loc) · 352 Bytes

Problem 3: Weighted Rearrangement

Problem Statement

Given a string s, sort it in decreasing order based on the frequency of the characters. The frequency of a character is the number of times it appears in the string. Return the sorted string.

Input Format

  • A string s.

Example

Input: s = "tree"
Output: "eert" (or "eetr")