String manipulation ought to be avoided II

First attempt to solving this problem led to time limit exceeded, too much string manipulation. One option to work around it is to make use of the String constructor that lets you create a string of length N composed of the same character. This problem is also a great example of frequency-counting strategy, common with string problems where the constraint is to use lower case characters only. I also nowadays like to use OpenAI ChatGPT 4.5+ to help me analyze the time complexity of some of these algorithms. Fos this one, for example, the analysis is clear that the time complexity is linear. Code is down below, cheers, ACC. Smallest Palindromic Rearrangement I - LeetCode You are given a palindromic string s . Return the lexicographically smallest palindromic permutation of s . Example 1: Input: s = "z" Output: "z" Explanation: A string of only one character is already the lexicographically smallest palindrome. Example 2:...