Skip to content

Commit 10837e6

Browse files
Removed WildCard Imports
1 parent 732517c commit 10837e6

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

src/main/java/com/thealgorithms/strings/SortCharacterByFrequency.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Reference: https://leetcode.com/problems/sort-characters-by-frequency/
22
package com.thealgorithms.strings;
3-
import java.util.*;
43

54
// Problem: Sort Characters By Frequency
65
// Pattern: HashMap + Priority Queue (Heap)
@@ -36,7 +35,9 @@ public String frequencySort(String s) {
3635
int diff = b.getValue() - a.getValue();
3736

3837
// If frequency same, sort by character
39-
if (diff == 0) return a.getKey() - b.getKey();
38+
if (diff == 0) {
39+
return a.getKey() - b.getKey();
40+
}
4041

4142
return diff;
4243
});

src/test/java/com/thealgorithms/strings/SortCharacterByFrequencyTest.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
package com.thealgorithms.strings;
22

3-
import static org.junit.jupiter.api.Assertions.*;
4-
5-
import org.junit.jupiter.api.Test;
6-
73
class SortCharacterByFrequencyTest {
84

95
private final SortCharacterByFrequency solution = new SortCharacterByFrequency();

0 commit comments

Comments
 (0)