Count days without meetings
摘要: 题目要求计算没有会议的天数。解决方法是先将会议按开始时间排序,然后比较后一个会议的开始时间和前一个会议的结束时间,以确定是否有重叠或连续。时间复杂度为O(n),空间复杂度为O(1)。
Question Count days without meetings Analysis sort meetings array by start time of each meeting compare start time of latter and end time of former Timing 21 min 14 sec Code `java public class Main1369 {...
Maximum matching of players with trainers
摘要: The problem involves matching players with trainers by sorting two arrays and using a two-pointer technique. The solution has a time complexity of O(n log n) due to sorting and a space complexity of O(log n). It was completed in 7 minutes and 41 seconds.
Question maximum matching of players with trainers Analysis Sort two arrays Two pointer to record matching position Timing 7 min 41 sec Code `java class Solution { public int matchPlaye...