Search⌘ K
AI Features

Solution: Largest Palindromic Number

Solution: Largest Palindromic Number asks you to reorder some or all digits in a string to form the largest palindrome, returned as a string without leading zeros and using at least one digit.

Statement

You are given a string num consisting of digits from 00 to 99. Your task is to return the largest possible palindromic number as a string by using some or all of the digits in num. The resulting palindromic number must not have leading zeros.

Note: You may reorder the digits freely, and you must use at least one digit from the num string.

Constraints:

  • 1≤1\leq num.length ...