[LeetCode] Minimum Length of Anagram Concatenation

3138. Minimum Length of Anagram Concatenation

You are given a string s, which is known to be a concatenation of anagrams of some string t.

Return the minimum possible length of the string t.

An anagram is a word or phrase formed by rearranging the letters of a word or phrase, typically using all the original letters exactly once.

Read more
[LeetCode] Minimum Number of Operations to Make Word K-Periodic

3137. Minimum Number of Operations to Make Word K-Periodic

You are given a string word of size n, and an integer k such that k divides n.

In one operation, you can pick any two indices i and j, that are divisible by k, then replace the substring of length k starting at i with the substring of length k starting at j. That is, replace the substring word[i..i + k - 1] with the substring word[j..j + k - 1].

Return the minimum number of operations required to make word k-periodic.

We say that word is k-periodic if there is some string s of length k such that word can be obtained by concatenating s an arbitrary number of times. For example, if word == “ababab”, then word is 2-periodic for s = "ab".

Read more
[LeetCode] Valid Word

3136. Valid Word

A word is considered valid if:

  • It contains a minimum of 3 characters.
  • It consists of the digits 0-9, and the uppercase and lowercase English letters. (Not necessary to have all of them.)
  • It includes at least one vowel.
  • It includes at least one consonant.

You are given a string word.

Return true if word is valid, otherwise, return false.

Notes:

  • 'a', 'e', 'i', 'o', 'u', and their uppercases are vowels.
  • A consonant is an English letter that is not a vowel.
Read more
[Codeforces] think-cell Round 1 D2. Sum over all Substrings (Hard Version)Read more
[Codeforces] think-cell Round 1 D1. Sum over all Substrings (Easy Version)Read more
[Codeforces] think-cell Round 1 C. Lexicographically LargestRead more
[Codeforces] Round 924 (Div. 2) C. Physical Education LessonRead more
[Codeforces] Educational Round 162 (Rated for Div. 2) D. SlimesRead more
[LeetCode] Maximum Number That Makes Result of Bitwise AND Zero

3125. Maximum Number That Makes Result of Bitwise AND Zero

Given an integer n, return the maximum integer x such that x <= n, and the bitwise AND of all the numbers in the range [x, n] is 0.

Read more
[LeetCode] Equalize Strings by Adding or Removing Characters at Ends

3135. Equalize Strings by Adding or Removing Characters at Ends

Given two strings initial and target, your task is to modify initial by performing a series of operations to make it equal to target.

In one operation, you can add or remove one character only at the beginning or the end of the string initial.

Return the minimum number of operations required to transform initial into target.

Read more