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 3162: Find the Number of Good Pairs I

You are given two integer arrays nums1 and nums2 of lengths n and m respectively, and a positive integer k. A pair (i, j) is called good if nums1[i] is divisible by nums2[j] * k (0 <= i <= n - 1, 0 <= j <= m - 1). Your task is to return the total number of good pairs.