#3518
Smallest Palindromic Rearrangement II
grandmaster · 2295 · lc hard +32 · 14.4% accepted · 72 likes · top 0%
Description
Given palindrome s and integer k, return the k-th lexicographically smallest palindromic permutation of s.
If fewer than k distinct palindromic permutations exist, return "".
Note: Rearrangements that produce the same string count as one.
Code
1
2
3