File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
s3325_count_substrings_with_k_frequency_characters_i
s3326_minimum_division_operations_to_make_array_non_decreasing Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 33// #Medium #2024_10_21_Time_2009_ms_(100.00%)_Space_45.2_MB_(100.00%)
44
55import java .util .HashMap ;
6+ import java .util .Map ;
67import java .util .PriorityQueue ;
78
89public class Solution {
@@ -13,8 +14,8 @@ public int numberOfSubstrings(String s, int k) {
1314 char curr = s .charAt (right );
1415 map .put (curr , map .getOrDefault (curr , 0 ) + 1 );
1516 PriorityQueue <Integer > queue = new PriorityQueue <>((a , b ) -> b - a );
16- for (char ele : map .keySet ()) {
17- queue .offer (map . get ( ele ));
17+ for (Map . Entry < Character , Integer > ele : map .entrySet ()) {
18+ queue .offer (ele . getValue ( ));
1819 }
1920 HashMap <Character , Integer > currMap = new HashMap <>(map );
2021 for (int left = 0 ; left <= right ; left ++) {
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ public class Solution {
77 private static final int [] SIEVE = new int [MAXI ];
88 private static boolean precompute = false ;
99
10- private void compute () {
10+ private static void compute () {
1111 if (precompute ) {
1212 return ;
1313 }
You can’t perform that action at this time.
0 commit comments