Coding

Palindromes in Base-10 and Base-k

Return the first n integers that are palindromes in both base-10 and base-k.

Input: n = 2, k = 4

Output: [1, 5]

Explanation: 1 is '1' in base 4, and 5 is '11' in base 4. Both are perfect palindromes in decimal and base 4 simultaneously.

Was asked at

Practice this question with AI

First session is free - no credit card required.

Go Premium

More interviews, more skills, more success.

No answers yet

Be the first to share your approach to this question

Practice More Questions