leetcode.cn 2025-07-07
🟡1353.maximum-number-of-events-that-can-be-attended
🏷️ Tags
#greedy #array #sorting #heap_priority_queue
🟡1353.maximum-number-of-events-that-can-be-attended
🏷️ Tags
#greedy #array #sorting #heap_priority_queue
Telegraph
maximum-number-of-events-that-can-be-attended
给你一个数组 events,其中 events[i] = [startDayi, endDayi] ,表示会议 i 开始于 startDayi ,结束于 endDayi 。 你可以在满足 startDayi <= d <= endDayi 中的任意一天 d 参加会议 i 。在任意一天 d 中只能参加一场会议。 请你返回你可以参加的 最大 会议数目。 示例 1: 输入:events = [[1,2],[2,3],[3,4]] 输出:3 解释:你可以参加所有的三个会议。 安排会议的一种方案如上图。 第 1…
leetcode.com 2025-07-07
🟡1353.maximum-number-of-events-that-can-be-attended
🏷️ Tags
#greedy #array #sorting #heap_priority_queue
🟡1353.maximum-number-of-events-that-can-be-attended
🏷️ Tags
#greedy #array #sorting #heap_priority_queue
Telegraph
maximum-number-of-events-that-can-be-attended
You are given an array of events where events[i] = [startDayi, endDayi]. Every event i starts at startDayi and ends at endDayi. You can attend an event i at any day d where startTimei <= d <= endTimei. You can only attend one event at any time d. Return the…
leetcode.cn 2025-07-08
🔴1751.maximum-number-of-events-that-can-be-attended-ii
🏷️ Tags
#array #binary_search #dynamic_programming #sorting
🔴1751.maximum-number-of-events-that-can-be-attended-ii
🏷️ Tags
#array #binary_search #dynamic_programming #sorting
Telegraph
maximum-number-of-events-that-can-be-attended-ii
给你一个 events 数组,其中 events[i] = [startDayi, endDayi, valuei] ,表示第 i 个会议在 startDayi 天开始,第 endDayi 天结束,如果你参加这个会议,你能得到价值 valuei 。同时给你一个整数 k 表示你能参加的最多会议数目。 你同一时间只能参加一个会议。如果你选择参加某个会议,那么你必须 完整 地参加完这个会议。会议结束日期是包含在会议内的,也就是说你不能同时参加一个开始日期与另一个结束日期相同的两个会议。 请你返回能得到的会议价值 最大和 。…
leetcode.com 2025-07-08
🔴1751.maximum-number-of-events-that-can-be-attended-ii
🏷️ Tags
#array #binary_search #dynamic_programming #sorting
🔴1751.maximum-number-of-events-that-can-be-attended-ii
🏷️ Tags
#array #binary_search #dynamic_programming #sorting
Telegraph
maximum-number-of-events-that-can-be-attended-ii
You are given an array of events where events[i] = [startDayi, endDayi, valuei]. The ith event starts at startDayi and ends at endDayi, and if you attend this event, you will receive a value of valuei. You are also given an integer k which represents the…
leetcode.cn 2025-07-09
🟡3439.reschedule-meetings-for-maximum-free-time-i
🏷️ Tags
#greedy #array #sliding_window
🟡3439.reschedule-meetings-for-maximum-free-time-i
🏷️ Tags
#greedy #array #sliding_window
Telegraph
reschedule-meetings-for-maximum-free-time-i
给你一个整数 eventTime 表示一个活动的总时长,这个活动开始于 t = 0 ,结束于 t = eventTime 。 同时给你两个长度为 n 的整数数组 startTime 和 endTime 。它们表示这次活动中 n 个时间 没有重叠 的会议,其中第 i 个会议的时间为 [startTime[i], endTime[i]] 。 你可以重新安排 至多 k 个会议,安排的规则是将会议时间平移,且保持原来的 会议时长 ,你的目的是移动会议后 最大化 相邻两个会议之间的 最长 连续空余时间。 移动前后所有会议之间的…
leetcode.com 2025-07-09
🟡3439.reschedule-meetings-for-maximum-free-time-i
🏷️ Tags
#greedy #array #sliding_window
🟡3439.reschedule-meetings-for-maximum-free-time-i
🏷️ Tags
#greedy #array #sliding_window
Telegraph
reschedule-meetings-for-maximum-free-time-i
You are given an integer eventTime denoting the duration of an event, where the event occurs from time t = 0 to time t = eventTime. You are also given two integer arrays startTime and endTime, each of length n. These represent the start and end time of n…
leetcode.cn 2025-07-10
🟡3440.reschedule-meetings-for-maximum-free-time-ii
🏷️ Tags
#greedy #array #enumeration
🟡3440.reschedule-meetings-for-maximum-free-time-ii
🏷️ Tags
#greedy #array #enumeration
Telegraph
reschedule-meetings-for-maximum-free-time-ii
给你一个整数 eventTime 表示一个活动的总时长,这个活动开始于 t = 0 ,结束于 t = eventTime 。 同时给你两个长度为 n 的整数数组 startTime 和 endTime 。它们表示这次活动中 n 个时间 没有重叠 的会议,其中第 i 个会议的时间为 [startTime[i], endTime[i]] 。 你可以重新安排 至多 一个会议,安排的规则是将会议时间平移,且保持原来的 会议时长 ,你的目的是移动会议后 最大化 相邻两个会议之间的 最长 连续空余时间。 请你返回重新安排会议以后,可以得到的…
leetcode.com 2025-07-10
🟡3440.reschedule-meetings-for-maximum-free-time-ii
🏷️ Tags
#greedy #array #enumeration
🟡3440.reschedule-meetings-for-maximum-free-time-ii
🏷️ Tags
#greedy #array #enumeration
Telegraph
reschedule-meetings-for-maximum-free-time-ii
You are given an integer eventTime denoting the duration of an event. You are also given two integer arrays startTime and endTime, each of length n. These represent the start and end times of n non-overlapping meetings that occur during the event between…
leetcode.com 2025-07-11
🔴2402.meeting-rooms-iii
🏷️ Tags
#array #hash_table #sorting #simulation #heap_priority_queue
🔴2402.meeting-rooms-iii
🏷️ Tags
#array #hash_table #sorting #simulation #heap_priority_queue
Telegraph
meeting-rooms-iii
You are given an integer n. There are n rooms numbered from 0 to n - 1. You are given a 2D integer array meetings where meetings[i] = [starti, endi] means that a meeting will be held during the half-closed time interval [starti, endi). All the values of starti…
leetcode.cn 2025-07-12
🔴1900.the-earliest-and-latest-rounds-where-players-compete
🏷️ Tags
#memoization #dynamic_programming
🔴1900.the-earliest-and-latest-rounds-where-players-compete
🏷️ Tags
#memoization #dynamic_programming
Telegraph
the-earliest-and-latest-rounds-where-players-compete
n 名运动员参与一场锦标赛,所有运动员站成一排,并根据 最开始的 站位从 1 到 n 编号(运动员 1 是这一排中的第一个运动员,运动员 2 是第二个运动员,依此类推)。 锦标赛由多个回合组成(从回合 1 开始)。每一回合中,这一排从前往后数的第 i 名运动员需要与从后往前数的第 i 名运动员比拼,获胜者将会进入下一回合。如果当前回合中运动员数目为奇数,那么中间那位运动员将轮空晋级下一回合。
leetcode.com 2025-07-12
🔴1900.the-earliest-and-latest-rounds-where-players-compete
🏷️ Tags
#memoization #dynamic_programming
🔴1900.the-earliest-and-latest-rounds-where-players-compete
🏷️ Tags
#memoization #dynamic_programming
Telegraph
the-earliest-and-latest-rounds-where-players-compete
There is a tournament where n players are participating. The players are standing in a single row and are numbered from 1 to n based on their initial standing position (player 1 is the first player in the row, player 2 is the second player in the row, etc.).…
leetcode.cn 2025-07-13
🟡2410.maximum-matching-of-players-with-trainers
🏷️ Tags
#greedy #array #two_pointers #sorting
🟡2410.maximum-matching-of-players-with-trainers
🏷️ Tags
#greedy #array #two_pointers #sorting
Telegraph
maximum-matching-of-players-with-trainers
给你一个下标从 0 开始的整数数组 players ,其中 players[i] 表示第 i 名运动员的 能力 值,同时给你一个下标从 0 开始的整数数组 trainers ,其中 trainers[j] 表示第 j 名训练师的 训练能力值 。 如果第 i 名运动员的能力值 小于等于 第 j 名训练师的能力值,那么第 i 名运动员可以 匹配 第 j 名训练师。除此以外,每名运动员至多可以匹配一位训练师,每位训练师最多可以匹配一位运动员。 请你返回满足上述要求 players 和 trainers 的 最大…
leetcode.com 2025-07-13
🟡2410.maximum-matching-of-players-with-trainers
🏷️ Tags
#greedy #array #two_pointers #sorting
🟡2410.maximum-matching-of-players-with-trainers
🏷️ Tags
#greedy #array #two_pointers #sorting
Telegraph
maximum-matching-of-players-with-trainers
You are given a 0-indexed integer array players, where players[i] represents the ability of the ith player. You are also given a 0-indexed integer array trainers, where trainers[j] represents the training capacity of the jth trainer. The ith player can match…
leetcode.cn 2025-07-14
🟢1290.convert-binary-number-in-a-linked-list-to-integer
🏷️ Tags
#linked_list #math
🟢1290.convert-binary-number-in-a-linked-list-to-integer
🏷️ Tags
#linked_list #math
Telegraph
convert-binary-number-in-a-linked-list-to-integer
给你一个单链表的引用结点 head。链表中每个结点的值不是 0 就是 1。已知此链表是一个整数数字的二进制表示形式。 请你返回该链表所表示数字的 十进制值 。 示例 1: 输入:head = [1,0,1] 输出:5 解释:二进制数 (101) 转化为十进制数 (5) 示例 2: 输入:head = [0] 输出:0 示例 3: 输入:head = [1] 输出:1 示例 4: 输入:head = [1,0,0,1,0,0,1,1,1,0,0,0,0,0,0] 输出:18880 示例 5: 输入:head…
leetcode.com 2025-07-14
🟢1290.convert-binary-number-in-a-linked-list-to-integer
🏷️ Tags
#linked_list #math
🟢1290.convert-binary-number-in-a-linked-list-to-integer
🏷️ Tags
#linked_list #math
Telegraph
convert-binary-number-in-a-linked-list-to-integer
Given head which is a reference node to a singly-linked list. The value of each node in the linked list is either 0 or 1. The linked list holds the binary representation of a number. Return the decimal value of the number in the linked list. The most significant…
leetcode.cn 2025-07-16
🟡3201.find-the-maximum-length-of-valid-subsequence-i
🏷️ Tags
#array #dynamic_programming
🟡3201.find-the-maximum-length-of-valid-subsequence-i
🏷️ Tags
#array #dynamic_programming
Telegraph
find-the-maximum-length-of-valid-subsequence-i
给你一个整数数组 nums。 nums 的子序列 sub 的长度为 x ,如果其满足以下条件,则称其为 有效子序列:
leetcode.com 2025-07-16
🟡3201.find-the-maximum-length-of-valid-subsequence-i
🏷️ Tags
#array #dynamic_programming
🟡3201.find-the-maximum-length-of-valid-subsequence-i
🏷️ Tags
#array #dynamic_programming
Telegraph
find-the-maximum-length-of-valid-subsequence-i
A subsequence sub of nums with length x is called valid if it satisfies: