Skip to content

Commit 1b16572

Browse files
committed
Improved task 3646
1 parent 096a520 commit 1b16572

File tree

1 file changed

+6
-6
lines changed
  • src/main/java/g3601_3700/s3646_next_special_palindrome_number

1 file changed

+6
-6
lines changed

src/main/java/g3601_3700/s3646_next_special_palindrome_number/Solution.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package 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

55
import java.util.ArrayList;
66
import java.util.Collections;
@@ -10,17 +10,17 @@
1010
import java.util.Set;
1111

1212
public 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) {

0 commit comments

Comments
 (0)