#3734
Lexicographically Smallest Palindromic Permutation Greater Than Target
international master · 2110 · lc hard +32 · 24.8% accepted · 39 likes · top 4%
Description
Given two length-n strings s and target of lowercase letters, return the lexicographically smallest rearrangement of s that is both a palindrome and strictly greater than target, or an empty string if none exists.
Code
1
2
3