Tap here to switch tabs
Problem
Submissions

Problem: Find the Largest Palindrome Divisible by K

med
30 min
Try to solve the Find the Largest Palindrome Divisible by K problem.

Statement

Given two integers n and k, return the largest n digit palindromic integer that is divisible by k, represented as a string.

A palindromic integer is an integer that reads the same backward as forward.

Note: An n digit integer cannot contain leading zeros.

Constraints:

  • 1≤1 \leq n ≤105\leq 10^5

  • 1≤1 \leq k ≤9\leq 9

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Find the Largest Palindrome Divisible by K

med
30 min
Try to solve the Find the Largest Palindrome Divisible by K problem.

Statement

Given two integers n and k, return the largest n digit palindromic integer that is divisible by k, represented as a string.

A palindromic integer is an integer that reads the same backward as forward.

Note: An n digit integer cannot contain leading zeros.

Constraints:

  • 1≤1 \leq n ≤105\leq 10^5

  • 1≤1 \leq k ≤9\leq 9