[LeetCode] Count Substrings That Can Be Rearranged to Contain a String II

3298. Count Substrings That Can Be Rearranged to Contain a String II

You are given two strings word1 and word2.

A string x is called valid if x can be rearranged to have word2 as a prefix.

Return the total number of valid substrings of word1.

Note that the memory limits in this problem are smaller than usual, so you must implement a solution with a linear runtime complexity.

Read more
[LeetCode] Count Substrings That Can Be Rearranged to Contain a String I

3297. Count Substrings That Can Be Rearranged to Contain a String I

You are given two strings word1 and word2.

A string x is called valid if x can be rearranged to have word2 as a prefix.

Return the total number of valid substrings of word1.

Read more
[LeetCode] Minimum Number of Seconds to Make Mountain Height Zero

3296. Minimum Number of Seconds to Make Mountain Height Zero

You are given an integer mountainHeight denoting the height of a mountain.
You are also given an integer array workerTimes representing the work time of workers in seconds.
The workers work simultaneously to reduce the height of the mountain. For worker i:

  • To decrease the mountain’s height by x, it takes workerTimes[i] + workerTimes[i] * 2 + ... + workerTimes[i] * xseconds. For example:

  • To reduce the height of the mountain by 1, it takes workerTimes[i] seconds.

  • To reduce the height of the mountain by 2, it takes workerTimes[i] + workerTimes[i] * 2 seconds, and so on.

Return an integer representing the minimum number of seconds required for the workers to make the height of the mountain 0.

Read more
[LeetCode] Report Spam Message

3295. Report Spam Message

You are given an array of strings message and an array of strings bannedWords.

An array of words is considered spam if there are at least two words in it that exactly match any word in bannedWords.

Return true if the array message is spam, and false otherwise.

Read more
[Hacker Cup 2024 Practice Round] Problem D2: Line of Delivery (Part 2)Read more
[Hacker Cup 2024 Practice Round] Problem D1: Line of Delivery (Part 1)Read more
[Hacker Cup 2024 Practice Round] Problem C: Fall in LineRead more
[Hacker Cup 2024 Practice Round] Problem B: Line by LineRead more
[Hacker Cup 2024 Practice Round] Problem A: Walk the LineRead more
[Codeforces] Pinely Round 4 (Div. 1 + Div. 2) D. Prime XOR ColoringRead more