上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 54 下一页
摘要: Given an array of strings, group anagrams together. For example, given: ["eat", "tea", "tan", "ate", "nat", "bat"], Return: 阅读全文
posted @ 2016-12-13 14:58 北叶青藤 阅读(161) 评论(0) 推荐(0)
摘要: Given an array of integers with possible duplicates, randomly output the index of a given target number. You can assume that the given target number m 阅读全文
posted @ 2016-12-13 10:21 北叶青藤 阅读(204) 评论(0) 推荐(0)
摘要: Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors. OJ's undirected graph serialization: Nodes are labeled 阅读全文
posted @ 2016-12-13 08:38 北叶青藤 阅读(195) 评论(0) 推荐(0)
摘要: Design a data structure that supports all following operations in O(1) time. insert(val): Inserts an item val to the set if not already present.remove 阅读全文
posted @ 2016-12-08 10:51 北叶青藤 阅读(254) 评论(0) 推荐(0)
摘要: Find the sum of all left leaves in a given binary tree. Example: 阅读全文
posted @ 2016-12-02 05:56 北叶青藤 阅读(230) 评论(0) 推荐(0)
摘要: Given an array of meeting time intervals consisting of start and end times [[s1,e1],[s2,e2],...] (si < ei), determine if a person could attend all mee 阅读全文
posted @ 2016-12-01 05:55 北叶青藤 阅读(724) 评论(0) 推荐(0)
摘要: 一个sequence,里面都是整数,求最长的subsequence的长度,使得这个subsquence的最大值和最小值相差不超过1. 比如[1,3,2,2,5,2,3,7]最长的subsequence是[3,2,2,2,3],所以应该返回5. 分析: 这题可以先排序,然后找出两个相差1的相邻值的最大 阅读全文
posted @ 2016-11-22 00:52 北叶青藤 阅读(384) 评论(0) 推荐(0)
摘要: Given a sorted array of integers nums and integer values a, b and c. Apply a function of the form f(x) = ax2 + bx + c to each element x in the array. 阅读全文
posted @ 2016-11-20 23:33 北叶青藤 阅读(279) 评论(0) 推荐(0)
摘要: Given a string, sort it in decreasing order based on the frequency of characters. Example 1: Example 2: 阅读全文
posted @ 2016-11-20 09:42 北叶青藤 阅读(312) 评论(0) 推荐(0)
摘要: 给你一个字符串和字典,从头扫到位,如果到当前的字符的字符串存在于字典中,则显示 buzz. 例子: ILOVEPINEAPPLEJUICE 字典: [pine, apple, pineapple, juice, applejuice] 那么当我们到达ILOVEPINE的时候,就要buzz,当我们到达 阅读全文
posted @ 2016-11-19 05:45 北叶青藤 阅读(448) 评论(0) 推荐(0)
上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 54 下一页