at 53:30, line 20, there is a bug - if pq is empty, curMax = 0 else curMax = pq.peek()
@LongweiSu6 ай бұрын
line 15, pq 初始化了个0,所以无论怎样都不会为空
@libbyy56082 жыл бұрын
古老师,在讲解435这道题(P20)的时候,应该是 “If conflict always remove current one, to leave more space for the later. ”?因为intervals按照结束时间排序,previous的结束时间应该是小于等于current的结束时间的,有冲突的时候remove current interval才会释放更多的time。代码里也是,当遇到conflict的时候,end的时间是不更改的。