Tap here to switch tabs
Problem
Submissions

Problem: Find the Largest Palindrome Divisible by K

Find the Largest Palindrome Divisible by K asks you to return the largest n-digit integer with no leading zeros that reads the same backward and forward and is divisible by k, as a string.

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

Find the Largest Palindrome Divisible by K asks you to return the largest n-digit integer with no leading zeros that reads the same backward and forward and is divisible by k, as a string.

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