There was an error while loading. Please reload this page.
1 parent 7a1404a commit 50c9ae4Copy full SHA for 50c9ae4
src/main/java/g2201_2300/s2217_find_palindrome_with_fixed_length/Solution.java
@@ -4,8 +4,8 @@
4
5
public class Solution {
6
public long[] kthPalindrome(int[] queries, int intLength) {
7
- long minHalf = (long) Math.pow(10, (intLength - 1) / 2);
8
- long maxIndex = (long) Math.pow(10, (intLength + 1) / 2) - minHalf;
+ long minHalf = (long) Math.pow(10, (intLength - 1) / 2D);
+ long maxIndex = (long) Math.pow(10, (intLength + 1) / 2D) - minHalf;
9
boolean isOdd = intLength % 2 == 1;
10
long[] res = new long[queries.length];
11
for (int i = 0; i < res.length; i++) {
0 commit comments