2
public long[] kthPalindrome(int[] queries, int intLength) {3
long[] res = new long[queries.length];4
for (int i = 0; i < queries.length; i++) {5
res[i] = nthPalindrome(queries[i], intLength);10
public long nthPalindrome(int nth, int kdigit) {11
long temp = (kdigit & 1) != 0 ? (kdigit / 2) : (kdigit / 2 - 1);12
long palindrome = (long) Math.pow(10, temp);13
palindrome += nth - 1;14
long res1 = palindrome;15
if ((kdigit & 1) > 0) palindrome /= 10;16
while (palindrome > 0) {17
res1 = res1 * 10 + (palindrome % 10);22
if (g.length() != kdigit) return -1;