随笔分类 -  intervals

616. Add Bold Tag in String
摘要:Given a string s and a list of strings dict, you need to add a closed pair of bold tag and to wrap the substrings in s that exist in dict. If two such substrings overlap, you need to wrap them to... 阅读全文

posted @ 2018-11-09 07:17 猪猪🐷

759. Employee Free Time
摘要:We are given a list schedule of employees, which represents the working time for each employee. Each employee has a list of non-overlapping Intervals, and these intervals are in sorted order. Retur... 阅读全文

posted @ 2018-11-09 06:44 猪猪🐷

interval intersection
摘要:example: input is two non-overlapping list of intervals , output is the list of overlaps l1 : [0, 2], [5, 7]. [9, 11] l2: [1, 3], [6, 10] overlap is [ 阅读全文

posted @ 2018-08-11 03:23 猪猪🐷

57 Insert Interval
摘要:Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary). You may assume that the intervals were initia 阅读全文

posted @ 2018-08-10 14:43 猪猪🐷

56. Merge Intervals
摘要:merge intervals leetcode 88 merge interval的变体, 问了下时间复杂度,求interval所覆盖区间的总长度。Follow up: nlogn的排序算法有哪些。哪些排序算法是稳定的。解释为什么quick sort不稳定。我没想到没问这么基础的问题,答得一般般啦 阅读全文

posted @ 2018-08-10 14:42 猪猪🐷

253. Meeting Rooms II
摘要:if the new interval's start is later than the smallest end index in our pq. then we can use the same room, and update the end , put it back to the pq. 阅读全文

posted @ 2018-08-09 17:03 猪猪🐷

554. Brick Wall
摘要:There is a brick wall in front of you. The wall is rectangular and has several rows of bricks. The bricks have the same height but different width. Yo 阅读全文

posted @ 2018-07-18 12:52 猪猪🐷

252. Meeting Rooms
摘要:/** * Definition for an interval. * public class Interval { * int start; * int end; * Interval() { start = 0; end = 0; } * Interval(int s, int e) { st 阅读全文

posted @ 2018-07-18 12:45 猪猪🐷

导航