[Codeforces] Educational Round 167 (Rated for Div. 2) D. Smithing SkillRead more
[Codeforces] EPIC Institute of Technology Round Summer 2024 (Div. 1 + Div. 2) D. World is MineRead more
[LeetCode] Uncommon Words from Two Sentences

884. Uncommon Words from Two Sentences

A sentence is a string of single-space separated words where each word consists only of lowercase letters.

A word is uncommon if it appears exactly once in one of the sentences, and does not appear in the other sentence.

Given two sentences s1 and s2, return a list of all the uncommon words. You may return the answer in any order.

Read more
[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