[Codeforces] Round 877 (Div. 2) D. Bracket WalkRead more
[Codeforces] Round 876 (Div. 2) D. Ball SortingRead more
[Codeforces] Round 890 (Div. 2) supported by Constructor Institute D. More WrongRead more
[CockroachDB] Architecture Overview

Architecture Overview

Read more
[LeetCode] Maximize the Number of Partitions After Operations

10038. Maximize the Number of Partitions After Operations

You are given a 0-indexed string s and an integer k.

You are to perform the following partitioning operations until s is empty:

  • Choose the longest prefix of s containing at most k distinct characters.
  • Delete the prefix from s and increase the number of partitions by one. The remaining characters (if any) in s maintain their initial order.

Before the operations, you are allowed to change at most one index in s to another lowercase English letter.

Return an integer denoting the maximum number of resulting partitions after the operations by optimally choosing at most one index to change.

Read more
[LeetCode] Maximum Size of a Set After Removals

10037. Maximum Size of a Set After Removals

You are given two 0-indexed integer arrays nums1 and nums2 of even length n.

You must remove n / 2 elements from nums1 and n / 2 elements from nums2. After the removals, you insert the remaining elements of nums1 and nums2 into a set s.

Return the maximum possible size of the set s.

Read more
[LeetCode] Minimum Moves to Capture The Queen

10036. Minimum Moves to Capture The Queen

There is a 1-indexed 8 x 8 chessboard containing 3 pieces.

You are given 6 integers a, b, c, d, e, and f where:

  • (a, b) denotes the position of the white rook.
  • (c, d) denotes the position of the white bishop.
  • (e, f) denotes the position of the black queen.

Given that you can only move the white pieces, return the minimum number of moves required to capture the black queen.

Note that:

  • Rooks can move any number of squares either vertically or horizontally, but cannot jump over other pieces.
  • Bishops can move any number of squares diagonally, but cannot jump over other pieces.
  • A rook or a bishop can capture the queen if it is located in a square that they can move to.
  • The queen does not move.
Read more
[LeetCode] Maximum Area of Longest Diagonal Rectangle

10035. Maximum Area of Longest Diagonal Rectangle

You are given a 2D 0-indexed integer array dimensions.

For all indices i, 0 <= i < dimensions.length, dimensions[i][0] represents the length and dimensions[i][1] represents the width of the rectangle i.

Return the area of the rectangle having the longest diagonal. If there are multiple rectangles with the longest diagonal, return the area of the rectangle having the maximum area.

Read more
[Codeforces] Pinely Round 2 (Div. 1 + Div. 2) E. SpeedrunRead more
[Codeforces] Harbour.Space Scholarship Contest 2023-2024 (Div. 1 + Div. 2) E. Guess GameRead more