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 11package g3601_3700 .s3646_next_special_palindrome_number ;
22
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 %)
44
55import java .util .ArrayList ;
66import java .util .Collections ;
1010import java .util .Set ;
1111
1212public class Solution {
13- private final List <Long > specials = new ArrayList <>();
13+ private final static List <Long > SPECIALS = new ArrayList <>();
1414
1515 public long specialPalindrome (long n ) {
16- if (specials .isEmpty ()) {
17- init (specials );
16+ if (SPECIALS .isEmpty ()) {
17+ init (SPECIALS );
1818 }
19- int pos = Collections .binarySearch (specials , n + 1 );
19+ int pos = Collections .binarySearch (SPECIALS , n + 1 );
2020 if (pos < 0 ) {
2121 pos = -pos - 1 ;
2222 }
23- return specials .get (pos );
23+ return SPECIALS .get (pos );
2424 }
2525
2626 private void init (List <Long > v ) {
You can’t perform that action at this time.
0 commit comments