Leetcode 3260. Find the Largest Palindrome Divisible by K
Find the largest n-digit palindrome (no leading zeros) divisible by k and return it as a string; with n up to 1e5 and k ≤ 9, the core challenge is to construct the lexicographically largest palindrome by selecting the first half and using modular arithmetic to adjust digits so the full palindrome is divisible by k while operating on very long strings.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
0
Hello Interview Premium
Your account is free and you can post anonymously if you choose.