[LeetCode] Shortest String That Contains Three Strings

2800. Shortest String That Contains Three Strings

Given three strings a, b, and c, your task is to find a string that has the minimum length and contains all three strings as substrings.

If there are multiple such strings, return the lexicographically smallest one.

Return a string denoting the answer to the problem.

Notes

  • A string a is lexicographically smaller than a string b (of the same length) if in the first position where a and b differ, string a has a letter that appears earlier in the alphabet than the corresponding letter in b.
  • A substring is a contiguous sequence of characters within a string.
Read more
[LeetCode] Count Complete Subarrays in an Array

2799. Count Complete Subarrays in an Array

You are given an array nums consisting of positive integers.

We call a subarray of an array complete if the following condition is satisfied:

  • The number of distinct elements in the subarray is equal to the number of distinct elements in the whole array.

Return the number of complete subarrays.

A subarray is a contiguous non-empty part of an array.

Read more
[LeetCode] Number of Employees Who Met the Target

2798. Number of Employees Who Met the Target

There are n employees in a company, numbered from 0 to n - 1. Each employee i has worked for hours[i] hours in the company.

The company requires each employee to work for at least target hours.

You are given a 0-indexed array of non-negative integers hours of length n and a non-negative integer target.

Return the integer denoting the number of employees who worked at least target hours.

Read more
[Codeforces] Round 547 (Div. 3) F2. Same Sum Blocks (Hard)Read more
[Codeforces] Round 547 (Div. 3) F1. Same Sum Blocks (Easy)Read more
[Codeforces] Round 547 (Div. 3) G. Privatization of Roads in TreelandRead more
[Codeforces] Forethought Future Cup - Final Round (Onsite Finalists Only) B. Chladni FigureRead more
[Codeforces] Round 551 (Div. 2) D. Serval and Rooted TreeRead more
[Codeforces] Educational Round 63 (Rated for Div. 2) D. Beautiful ArrayRead more
[Codeforces] Round 555 (Div. 3) D. N Problems During K DaysRead more