随笔分类 -  [LeetCode]

上一页 1 2 3 4 5 6 ··· 8 下一页
摘要:Problem:This is afollow upofShortest Word Distance. The only difference is now you are given the list of words and your method will be calledrepeatedl... 阅读全文
posted @ 2015-09-14 00:09 airforce 阅读(183) 评论(0) 推荐(0)
摘要:Problem:Given an array of meeting time intervals consisting of start and end times[[s1,e1],[s2,e2],...](si= min_heap.peek()) { min_heap.poll(); ... 阅读全文
posted @ 2015-09-13 12:02 airforce 阅读(1140) 评论(0) 推荐(0)
摘要:Problem:Given an array of meeting time intervals consisting of start and end times[[s1,e1],[s2,e2],...](si interval_sort = new Comparator() { @Over... 阅读全文
posted @ 2015-09-13 10:11 airforce 阅读(536) 评论(0) 推荐(0)
摘要:Problem:A strobogrammatic number is a number that looks the same when rotated 180 degrees (looked at upside down).Find all strobogrammatic numbers tha... 阅读全文
posted @ 2015-09-13 09:18 airforce 阅读(746) 评论(0) 推荐(0)
摘要:Problem:There are a row ofnhouses, each house can be painted with one of thekcolors. The cost of painting each house with a certain color is different... 阅读全文
posted @ 2015-09-13 06:20 airforce 阅读(3268) 评论(0) 推荐(0)
摘要:Problem:There are a row ofnhouses, each house can be painted with one of the three colors: red, blue or green. The cost of painting each house with a ... 阅读全文
posted @ 2015-09-13 04:41 airforce 阅读(666) 评论(0) 推荐(0)
摘要:Problem:Given a positive integern, find the least number of perfect square numbers (for example,1, 4, 9, 16, ...) which sum ton.For example, givenn=12... 阅读全文
posted @ 2015-09-12 11:15 airforce 阅读(361) 评论(0) 推荐(0)
摘要:Problem:Given an array ofnintegersnumsand atarget, find the number of index tripletsi, j, kwith0 ret = new ArrayList (); ret.add(0); Ar... 阅读全文
posted @ 2015-09-12 07:37 airforce 阅读(555) 评论(0) 推荐(0)
摘要:Problem:Givennnodes labeled from0ton - 1and a list of undirected edges (each edge is a pair of nodes), write a function to check whether these edges m... 阅读全文
posted @ 2015-09-12 05:25 airforce 阅读(488) 评论(0) 推荐(0)
摘要:Problem:Design an algorithm to encodea list of stringstoa string. The encoded string is then sent over the network and is decoded back to the original... 阅读全文
posted @ 2015-09-11 07:29 airforce 阅读(788) 评论(0) 推荐(0)
摘要:Problem:Given a non-empty binary search tree and a target value, find the value in the BST that is closest to the target.Note:Given target value is a ... 阅读全文
posted @ 2015-09-11 02:04 airforce 阅读(290) 评论(0) 推荐(0)
摘要:Problem:Given a string, find the length of the longest substring T that contains at most 2 distinct characters.For example, Given s =“eceba”,T is "ece... 阅读全文
posted @ 2015-09-10 11:27 airforce 阅读(182) 评论(0) 推荐(0)
摘要:Problem:A strobogrammatic number is a number that looks the same when rotated 180 degrees (looked at upside down).Write a function to determine if a n... 阅读全文
posted @ 2015-09-10 09:37 airforce 阅读(177) 评论(0) 推荐(0)
摘要:Problem:Given a sorted integer array where the range of elements are [lower,upper] inclusive, return its missing ranges.For example, given[0, 1, 3, 50... 阅读全文
posted @ 2015-09-10 08:43 airforce 阅读(416) 评论(0) 推荐(0)
摘要:Problem:Given a string, determine if a permutation of the string could form a palindrome.For example,"code"-> False,"aab"-> True,"carerac"-> True.Gene... 阅读全文
posted @ 2015-09-10 07:34 airforce 阅读(861) 评论(0) 推荐(0)
摘要:Problem:There is a fence with n posts, each post can be painted with one of the k colors.You have to paint all the posts such that no more than two ad... 阅读全文
posted @ 2015-09-10 06:49 airforce 阅读(1631) 评论(0) 推荐(1)
摘要:Problem:Implementint sqrt(int x).Compute and return the square root ofx.Conclusion for Binary Search Problem:Binary search is such an elegant way of s... 阅读全文
posted @ 2015-09-09 10:33 airforce 阅读(291) 评论(0) 推荐(0)
摘要:Problem:Given an array of strings, group anagrams together.For example, given:["eat", "tea", "tan", "ate", "nat", "bat"],Return:[ ["ate", "eat","tea"... 阅读全文
posted @ 2015-09-09 06:42 airforce 阅读(376) 评论(0) 推荐(0)
摘要:Problem:Given a set ofnon-overlappingintervals, insert a new interval into the intervals (merge if necessary).You may assume that the intervals were i... 阅读全文
posted @ 2015-09-09 01:50 airforce 阅读(153) 评论(0) 推荐(0)
摘要:Problem:Given a stringsconsists of upper/lower-case alphabets and empty space characters' ', return the length of last word in the string.If the last ... 阅读全文
posted @ 2015-09-09 00:09 airforce 阅读(161) 评论(0) 推荐(0)

上一页 1 2 3 4 5 6 ··· 8 下一页