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:

  1. Remove the longest prefix from word that consists of the same character repeating up to 9 times.
  2. Append the length of this prefix followed by the character to comp. Return the resulting string comp.

Leetcode 3169: Count Days Without Meetings

You are given a positive integer days representing the total number of days an employee is available for work (starting from day 1). Additionally, you are given a 2D array meetings, where meetings[i] = [start_i, end_i] represents the start and end days (inclusive) of the ith meeting. Your task is to determine the number of days when the employee is available for work, but no meetings are scheduled.

Leetcode 3179: Find the N-th Value After K Seconds

You are given two integers, n and k. Initially, you have an array a of size n, where each element is initialized to 1. After each second, every element in the array is updated to be the sum of all preceding elements plus the element itself. The process repeats for k seconds. You need to return the value of the last element of the array, a[n - 1], after k seconds. Since the result may be very large, return it modulo (10^9 + 7).