Skip to content

Commit fd081e6

Browse files
refactor 451
1 parent d8d6604 commit fd081e6

File tree

1 file changed

+0
-42
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+0
-42
lines changed

src/main/java/com/fishercoder/solutions/_451.java

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -6,48 +6,6 @@
66
import java.util.List;
77
import java.util.Map;
88

9-
/**
10-
* 451. Sort Characters By Frequency
11-
*
12-
* Given a string, sort it in decreasing order based on the frequency of characters.
13-
14-
Example 1:
15-
16-
Input:
17-
"tree"
18-
19-
Output:
20-
"eert"
21-
22-
Explanation:
23-
'e' appears twice while 'r' and 't' both appear once.
24-
So 'e' must appear before both 'r' and 't'. Therefore "eetr" is also a valid answer.
25-
26-
Example 2:
27-
28-
Input:
29-
"cccaaa"
30-
31-
Output:
32-
"cccaaa"
33-
34-
Explanation:
35-
Both 'c' and 'a' appear three times, so "aaaccc" is also a valid answer.
36-
Note that "cacaca" is incorrect, as the same characters must be together.
37-
38-
Example 3:
39-
40-
Input:
41-
"Aabb"
42-
43-
Output:
44-
"bbAa"
45-
46-
Explanation:
47-
"bbaA" is also a valid answer, but "Aabb" is incorrect.
48-
Note that 'A' and 'a' are treated as two different characters.
49-
50-
*/
519
public class _451 {
5210

5311
public static class Solution1 {

0 commit comments

Comments
 (0)