Tap here to switch tabs
Problem
Submissions

Problem: Smallest Palindromic Permutation Greater Than Target

Smallest Palindromic Permutation Greater Than Target asks you to rearrange one string into the lexicographically smallest palindrome strictly greater than a target string, or return empty if none exists.

Statement

Given two strings s and target of equal length, return the lexicographically smallest palindromic permutation of s that is strictly greater than target. If no such palindromic permutation exists, return an empty string "".

A string is called a palindrome if it reads the same forward and backward.

Constraints:

  • 1≤1 \leq n ==== s.length ==== target.length ≤300\leq 300

  • s and target consist of only lowercase English letters.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Smallest Palindromic Permutation Greater Than Target

Smallest Palindromic Permutation Greater Than Target asks you to rearrange one string into the lexicographically smallest palindrome strictly greater than a target string, or return empty if none exists.

Statement

Given two strings s and target of equal length, return the lexicographically smallest palindromic permutation of s that is strictly greater than target. If no such palindromic permutation exists, return an empty string "".

A string is called a palindrome if it reads the same forward and backward.

Constraints:

  • 1≤1 \leq n ==== s.length ==== target.length ≤300\leq 300

  • s and target consist of only lowercase English letters.