Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update Solution.java
  • Loading branch information
javadev authored Jun 12, 2022
commit 581beb241deaa815c99f1191fcbd86bdd6f23895
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

// #Medium #Array #Math #2022_06_12_Time_37_ms_(88.60%)_Space_53.7_MB_(77.19%)

@SuppressWarnings("java:S2184")
public class Solution {
public long[] kthPalindrome(int[] queries, int intLength) {
long minHalf = (long) Math.pow(10, (intLength - 1) / 2D);
long maxIndex = (long) Math.pow(10, (intLength + 1) / 2D) - minHalf;
long minHalf = (long) Math.pow(10, (intLength - 1) / 2);
long maxIndex = (long) Math.pow(10, (intLength + 1) / 2) - minHalf;
boolean isOdd = intLength % 2 == 1;
long[] res = new long[queries.length];
for (int i = 0; i < res.length; i++) {
Expand Down