[Codeforces] Round 905 (Div. 1) B. Time TravelRead more
[Codeforces] Round 905 (Div. 3) G2. Dances (Hard Version)Read more
[Codeforces] Round 900 (Div. 3) F. Vasilije Loves Number TheoryRead more
[LeetCode] Check if the Rectangle Corner Is Reachable

3235. Check if the Rectangle Corner Is Reachable

You are given two positive integers X and Y, and a 2D array circles, where circles[i] = [xi, yi, ri] denotes a circle with center at (xi, yi) and radius ri.

There is a rectangle in the coordinate plane with its bottom left corner at the origin and top right corner at the coordinate (X, Y). You need to check whether there is a path from the bottom left corner to the top right corner such that the entire path lies inside the rectangle, does not touch or lie inside any circle, and touches the rectangle only at the two corners.

Return true if such a path exists, and false otherwise.

Read more
[LeetCode] Count the Number of Substrings With Dominant Ones

3234. Count the Number of Substrings With Dominant Ones

You are given a binary string s.

Return the number of substrings with dominant ones.

A string has dominant ones if the number of ones in the string is greater than or equal to the square of the number of zeros in the string.

Read more
[LeetCode] Find the Count of Numbers Which Are Not Special

3233. Find the Count of Numbers Which Are Not Special

You are given 2 positive integers l and r. For any number x, all positive divisors of x except x are called the proper divisors of x.

A number is called special if it has exactly 2 proper divisors. For example:

  • The number 4 is special because it has proper divisors 1 and 2.
  • The number 6 is not special because it has proper divisors 1, 2, and 3.

Return the count of numbers in the range [l, r] that are not special.

Read more
[LeetCode] Find if Digit Game Can Be Won

3232. Find if Digit Game Can Be Won

You are given an array of positive integers nums.

Alice and Bob are playing a game. In the game, Alice can choose either all single-digit numbers or all double-digit numbers from nums, and the rest of the numbers are given to Bob. Alice wins if the sum of her numbers is strictly greater than the sum of Bob’s numbers.

Return true if Alice can win this game, otherwise, return false.

Read more
[Codeforces] Round 899 (Div. 2) D. Tree XORRead more
[Codeforces] COMPFEST 15 - Preliminary Online Mirror (Unrated, ICPC Rules, Teams Preferred) C. Completely Searching for InversionsRead more
[LeetCode] Sort Array by Increasing Frequency

1636. Sort Array by Increasing Frequency

Given an array of integers nums, sort the array in increasing order based on the frequency of the values. If multiple values have the same frequency, sort them in decreasing order.

Return the sorted array.

Read more