File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
src/main/java/g3601_3700/s3646_next_special_palindrome_number Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 1
1
package g3601_3700 .s3646_next_special_palindrome_number ;
2
2
3
- // #Hard #Weekly_Contest_462 #2025_08_10_Time_20_ms_(77.60 %)_Space_45.50_MB_(18.75 %)
3
+ // #Hard #Weekly_Contest_462 #2025_08_11_Time_22_ms_(100.00 %)_Space_45.26_MB_(100.00 %)
4
4
5
5
import java .util .ArrayList ;
6
6
import java .util .Collections ;
10
10
import java .util .Set ;
11
11
12
12
public class Solution {
13
- private final List <Long > specials = new ArrayList <>();
13
+ private final static List <Long > SPECIALS = new ArrayList <>();
14
14
15
15
public long specialPalindrome (long n ) {
16
- if (specials .isEmpty ()) {
17
- init (specials );
16
+ if (SPECIALS .isEmpty ()) {
17
+ init (SPECIALS );
18
18
}
19
- int pos = Collections .binarySearch (specials , n + 1 );
19
+ int pos = Collections .binarySearch (SPECIALS , n + 1 );
20
20
if (pos < 0 ) {
21
21
pos = -pos - 1 ;
22
22
}
23
- return specials .get (pos );
23
+ return SPECIALS .get (pos );
24
24
}
25
25
26
26
private void init (List <Long > v ) {
You can’t perform that action at this time.
0 commit comments