[LeetCode] Remove Methods From Project

3310. Remove Methods From Project

You are maintaining a project that has n methods numbered from 0 to n - 1.

You are given two integers n and k, and a 2D integer array invocations, where invocations[i] = [ai, bi] indicates that method ai invokes method bi.

There is a known bug in method k. Method k, along with any method invoked by it, either directly or indirectly, are considered suspicious and we aim to remove them.

A group of methods can only be removed if no method outside the group invokes any methods within it.

Return an array containing all the remaining methods after removing all the suspicious methods. You may return the answer in any order. If it is not possible to remove all the suspicious methods, none should be removed.

Read more
[LeetCode] Maximum Possible Number by Binary Concatenation

3309. Maximum Possible Number by Binary Concatenation

You are given an array of integers nums of size 3.

Return the maximum possible number whose binary representation can be formed by concatenating the binary representation of all elements in nums in some order.

Note that the binary representation of any number does not contain leading zeros.

Read more
[Codeforces] EPIC Institute of Technology Round August 2024 (Div. 1 + Div. 2) D1. DFS Checker (Easy Version)Read more
[Codeforces] Round 967 (Div. 2) D. Longest Max Min SubsequenceRead more
[Codeforces] Round 966 (Div. 3) F. Color Rows and ColumnsRead more
[Codeforces] Round 964 (Div. 4) G2. Ruler (hard version)Read more
[LeetCode] Rank Transform of an Array

1331. Rank Transform of an Array

Given an array of integers arr, replace each element with its rank.

The rank represents how large the element is. The rank has the following rules:

  • Rank is an integer starting from 1.
  • The larger the element, the larger the rank. If two elements are equal, their rank must be the same.
  • Rank should be as small as possible.
Read more
[Codeforces] Round 965 (Div. 2) C. Perform Operations to Maximize ScoreRead more
[Codeforces] Round 962 (Div. 3) F. BombRead more
[Codeforces] Round 962 (Div. 3) E. DecodeRead more