All Posts
Leetcode 3138: Minimum Length of Anagram Concatenation
You are given a string s, which is a concatenation of several anagrams of some string t. Your task is to find the minimum possible length of the string t. An anagram is formed by rearranging the letters of a string. For example, ‘abc’ and ‘cab’ are anagrams of each other. The string t is the original string that has been rearranged multiple times to form s.
Leetcode 3163: String Compression III
You are given a string word. Compress the string using the following algorithm:
Begin with an empty string comp. While word is not empty, perform the following operation:
- Remove the longest prefix from
wordthat consists of the same character repeating up to 9 times. - Append the length of this prefix followed by the character to
comp. Return the resulting stringcomp.