[AtCoder] E - Reachable SetRead more
[LeetCode] Maximize Profit from Task Assignment

3476. Maximize Profit from Task Assignment

You are given an integer array workers, where workers[i] represents the skill level of the ith worker. You are also given a 2D integer array tasks, where:

  • tasks[i][0] represents the skill requirement needed to complete the task.
  • tasks[i][1] represents the profit earned from completing the task.

Each worker can complete at most one task, and they can only take a task if their skill level is equal to the task’s skill requirement. An additional worker joins today who can take up any task, regardless of the skill requirement.

Return the maximum total profit that can be earned by optimally assigning the tasks to the workers.

Read more
[LeetCode] Number of Student Replacements

3616. Number of Student Replacements

You are given an integer array ranks where ranks[i] represents the rank of the ith student arriving in order. A lower number indicates a better rank.

Initially, the first student is selected by default.

A replacement occurs when a student with a strictly better rank arrives and replaces the current selection.

Return the total number of replacements made.

Read more
[LeetCode] Longest Semi-Repeating Subarray

3641. Longest Semi-Repeating Subarray

You are given an integer array nums of length n and an integer k.

A semi‑repeating subarray is a contiguous subarray in which at most k elements repeat (i.e., appear more than once).

Return the length of the longest semi‑repeating subarray in nums.

Read more
[LeetCode] Sort Threats by Severity and Exploitability

3631. Sort Threats by Severity and Exploitability

You are given a 2D integer array threats, where each threats[i] = [IDi, sevi, expi]

  • IDi: Unique identifier of the threat.
  • sevi: Indicates the severity of the threat.
  • expi: Indicates the exploitability of the threat.

The score of a threat i is defined as: score = 2 × sevi + expi

Your task is to return threats sorted in descending order of score.

If multiple threats have the same score, sort them by ascending ID.

Read more
[AtCoder] A - Adjacent DeleteRead more
[AtCoder] E - Ringo`s Favorite Numbers 3Read more
[AtCoder] F - Range Power SumRead more
[AtCoder] B - Uniform SumRead more
[AtCoder] E - Tree GameRead more