#3517

Smallest Palindromic Rearrangement I

medium · 63.5% accepted · 81 likes · top 66%

string · sorting · counting sort

⊣ practice⊣ open on leetcode ↗

Description

You are given a palindromic string s.

Return the lexicographically smallest palindromic permutation of s.

Solution