#3260

Find the Largest Palindrome Divisible by K

grandmaster · 2280 · lc hard +32 · 16.9% accepted · 108 likes · top 1%

Description

You are given positive integers n and k. An integer is k-palindromic if it is a palindrome divisible by k.

Return the largest k-palindromic integer with exactly n digits as a string (no leading zeros).

Code

1
2
3