[Codeforces] Round 954 (Div. 3) F. Non-academic ProblemRead more
[Codeforces] Round 954 (Div. 3) E. Beautiful ArrayRead more
[Codeforces] Round 952 (Div. 4) H1. Maximize the Largest Component (Easy Version)Read more
[Codeforces] Round 952 (Div. 4) G. D-FunctionRead more
[LeetCode] Minimum Number of Valid Strings to Form Target II

3292. Minimum Number of Valid Strings to Form Target II

You are given an array of strings words and a string target.

A string x is called valid if x is a prefix of any string in words.

Return the minimum number of valid strings that can be concatenated to form target. If it is not possible to form target, return -1.

A prefix of a string is a substring that starts from the beginning of the string and extends to any point within it.

Read more
[LeetCode] Minimum Number of Valid Strings to Form Target I

3291. Minimum Number of Valid Strings to Form Target I

You are given an array of strings words and a string target.

A string x is called valid if x is a prefix of any string in words.

Return the minimum number of valid strings that can be concatenated to form target. If it is not possible to form target, return -1.

A prefix of a string is a substring that starts from the beginning of the string and extends to any point within it.

Read more
[LeetCode] Maximum Multiplication Score

3290. Maximum Multiplication Score

You are given an integer array a of size 4 and another integer array b of size at least 4.

You need to choose 4 indices i0, i1, i2, and i3 from the array b such that i0 < i1 < i2 < i3. Your score will be equal to the value a[0] * b[i0] + a[1] * b[i1] + a[2] * b[i2] + a[3] * b[i3].

Return the maximum score you can achieve.

Read more
[LeetCode] The Two Sneaky Numbers of Digitville

3289. The Two Sneaky Numbers of Digitville

In the town of Digitville, there was a list of numbers called nums containing integers from 0 to n - 1. Each number was supposed to appear exactly once in the list, however, two mischievous numbers sneaked in an additional time, making the list longer than usual.

As the town detective, your task is to find these two sneaky numbers. Return an array of size two containing the two numbers (in any order), so peace can return to Digitville.

Read more
[LeetCode] Length of the Longest Increasing Path

3288. Length of the Longest Increasing Path

You are given a 2D array of integers coordinates of length n and an integer k, where 0 <= k < n.

coordinates[i] = [xi, yi] indicates the point (xi, yi) in a 2D plane.

An increasing path of length m is defined as a list of points (x1, y1), (x2, y2), (x3, y3), …, (xm, ym) such that:

  • xi < xi + 1 and yi < yi + 1 for all i where 1 <= i < m.
  • (xi, yi) is in the given coordinates for all i where 1 <= i <= m.

Return the maximum length of an increasing path that contains coordinates[k].

Read more
[LeetCode] Find the Maximum Sequence Value of Array

3287. Find the Maximum Sequence Value of Array

You are given an integer array nums and a positive integer k.

The value of a sequence seq of size 2 * x is defined as:

  • (seq[0] OR seq[1] OR ... OR seq[x - 1]) XOR (seq[x] OR seq[x + 1] OR ... OR seq[2 * x - 1]).

Return the maximum value of any subsequence of nums having size 2 * k.

Read more