上一页 1 2 3 4 5 6 7 ··· 17 下一页
摘要: Given a collection of intervals, merge all overlapping intervals. For example, Given [1,3],[2,6],[8,10],[15,18], return [1,6],[8,10],[15,18]. 思路1:现将左右 阅读全文
posted @ 2017-02-26 03:35 lettuan 阅读(301) 评论(0) 推荐(0) 编辑
摘要: Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. 思路:参考:http://www.cnblogs.com/zuoyuan/p/3772372.html 阅读全文
posted @ 2017-02-26 01:39 lettuan 阅读(126) 评论(0) 推荐(0) 编辑
摘要: Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999. 思路:先建立一个对应的dict。注意转换规则中的特例,比如XL (=50-10), 阅读全文
posted @ 2017-02-26 01:15 lettuan 阅读(121) 评论(0) 推荐(0) 编辑
摘要: There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity sh 阅读全文
posted @ 2017-02-25 14:57 lettuan 阅读(206) 评论(0) 推荐(0) 编辑
摘要: Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.) You have 阅读全文
posted @ 2017-02-25 03:24 lettuan 阅读(162) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree where all the right nodes are either leaf nodes with a sibling (a left node that shares the same parent node) or empty, flip it up 阅读全文
posted @ 2017-02-21 13:47 lettuan 阅读(320) 评论(0) 推荐(0) 编辑
摘要: Given an input string, reverse the string word by word. For example, Given s = "the sky is blue", return "blue is sky the". Update (2015-02-12): For C 阅读全文
posted @ 2017-02-21 04:21 lettuan 阅读(97) 评论(0) 推荐(0) 编辑
摘要: Given a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You must do this in-place without altering the nodes' values. For 阅读全文
posted @ 2017-02-20 13:01 lettuan 阅读(120) 评论(0) 推荐(0) 编辑
摘要: A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null. Return a deep copy 阅读全文
posted @ 2017-02-20 10:18 lettuan 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 思路: 阅读全文
posted @ 2017-02-20 06:39 lettuan 阅读(154) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 17 下一页