Skip to content

Commit 50c9ae4

Browse files
authored
Update Solution.java
1 parent 7a1404a commit 50c9ae4

File tree

1 file changed

+2
-2
lines changed
  • src/main/java/g2201_2300/s2217_find_palindrome_with_fixed_length

1 file changed

+2
-2
lines changed

src/main/java/g2201_2300/s2217_find_palindrome_with_fixed_length/Solution.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
public class Solution {
66
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;
7+
long minHalf = (long) Math.pow(10, (intLength - 1) / 2D);
8+
long maxIndex = (long) Math.pow(10, (intLength + 1) / 2D) - minHalf;
99
boolean isOdd = intLength % 2 == 1;
1010
long[] res = new long[queries.length];
1111
for (int i = 0; i < res.length; i++) {

0 commit comments

Comments
 (0)