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 3146: Permutation Difference between Two Strings
You are given two strings, s and t, where every character occurs at most once in both strings and t is a permutation of s. The permutation difference between s and t is defined as the sum of the absolute differences between the index of each character in s and the index of the occurrence of the same character in t. Your task is to compute the permutation difference between s and t.
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.