3476. Maximize Profit from Task Assignment
You are given an integer array
workers, whereworkers[i]represents the skill level of theithworker. You are also given a 2D integer arraytasks, 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.
3616. Number of Student Replacements
You are given an integer array
rankswhereranks[i]represents the rank of theithstudent 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.
3641. Longest Semi-Repeating Subarray
You are given an integer array
numsof lengthnand an integerk.A semi‑repeating subarray is a contiguous subarray in which at most
kelements repeat (i.e., appear more than once).Return the length of the longest semi‑repeating subarray in
nums.
3631. Sort Threats by Severity and Exploitability
You are given a 2D integer array
threats, where eachthreats[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
iis defined as:score = 2 × sevi + expiYour task is to return
threatssorted in descending order of score.If multiple threats have the same score, sort them by ascending ID.