1. Class Monitor

Array Easy

Problem Statement:

Given a sequence of ranks of students, count how many times the current rank is less than any previous rank (i.e., how many times you need to "cut the name" because someone with better rank came before).

Example:

Input: ranks = [5, 2, 7, 3, 1]
Output: 6
Explanation:
- At index 1 (rank 2): cuts 1 name (rank 5)
- At index 3 (rank 3): cuts 2 names (ranks 5, 7)
- At index 4 (rank 1): cuts 3 names (ranks 5, 7, 3)
Total = 1 + 2 + 3 = 6

Constraints:

  • 1 ≤ n ≤ 10^5
  • 1 ≤ ranks[i] ≤ 10^9

2. Corona for Computer

Bit Manipulation Medium

Problem Statement:

Given an array of decimal numbers, remove 'n' least significant binary bits from each number and output the new decimal values.

Example:

Input: numbers = [25, 18, 33], n = 2
Output: [6, 4, 8]

Explanation:
25 = 11001 (binary) → Remove 2 LSBs → 110 (binary) = 6 (decimal)
18 = 10010 (binary) → Remove 2 LSBs → 100 (binary) = 4 (decimal)
33 = 100001 (binary) → Remove 2 LSBs → 1000 (binary) = 8 (decimal)

Constraints:

  • 1 ≤ array length ≤ 10^4
  • 0 ≤ n ≤ 30
  • 0 ≤ numbers[i] ≤ 10^9

3. Help of Prepsters (Set Bits)

Bit Manipulation Medium

Problem Statement:

Count how many numbers less than n have exactly k set bits in their binary representation.

Example:

Input: n = 10, k = 2
Output: 4

Explanation:
Numbers < 10 with exactly 2 set bits:
3 = 11 (binary) - has 2 set bits āœ“
5 = 101 (binary) - has 2 set bits āœ“
6 = 110 (binary) - has 2 set bits āœ“
9 = 1001 (binary) - has 2 set bits āœ“
Total = 4

Constraints:

  • 1 ≤ n ≤ 10^6
  • 0 ≤ k ≤ 20

4. Momentum (LinkedList)

Linked List Easy

Problem Statement:

Given a linked list where each node has mass (m) and velocity (v), compute total momentum = sum(m*v) for all nodes.

Example:

Input: LinkedList with nodes:
Node 1: mass=2, velocity=3
Node 2: mass=5, velocity=2
Node 3: mass=1, velocity=10

Output: 26

Explanation:
Total momentum = (2*3) + (5*2) + (1*10) = 6 + 10 + 10 = 26

Constraints:

  • 1 ≤ number of nodes ≤ 10^5
  • 1 ≤ mass, velocity ≤ 10^3

šŸ“š More Problems Coming Soon

We're continuously adding more coding problems. Check back regularly for updates!

Additional topics include: Lazy String (LCS), Prime Sum, Perfect Numbers, Sorting Algorithms, and many more...