上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 53 下一页
摘要: Find the sum of all left leaves in a given binary tree. Example: 阅读全文
posted @ 2016-12-02 05:56 北叶青藤 阅读(220) 评论(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 北叶青藤 阅读(716) 评论(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 北叶青藤 阅读(378) 评论(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 北叶青藤 阅读(270) 评论(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 北叶青藤 阅读(305) 评论(0) 推荐(0) 编辑
摘要: 给你一个字符串和字典,从头扫到位,如果到当前的字符的字符串存在于字典中,则显示 buzz. 例子: ILOVEPINEAPPLEJUICE 字典: [pine, apple, pineapple, juice, applejuice] 那么当我们到达ILOVEPINE的时候,就要buzz,当我们到达 阅读全文
posted @ 2016-11-19 05:45 北叶青藤 阅读(419) 评论(0) 推荐(0) 编辑
摘要: Given an array which consists of non-negative integers and an integer m, you can split the array into m non-empty continuous subarrays. Write an algor 阅读全文
posted @ 2016-11-17 14:17 北叶青藤 阅读(274) 评论(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 @ 2016-11-15 00:33 北叶青藤 阅读(307) 评论(0) 推荐(0) 编辑
摘要: The question and solution are from: http://www.geeksforgeeks.org/convert-given-binary-tree-doubly-linked-list-set-3/ Given a Binary Tree (BT), convert 阅读全文
posted @ 2016-11-11 07:54 北叶青藤 阅读(579) 评论(0) 推荐(0) 编辑
摘要: From: https://discuss.leetcode.com/topic/89/write-elevator-program-using-event-driven-programming/9 We can divide into three main components: User Use 阅读全文
posted @ 2016-11-09 02:27 北叶青藤 阅读(340) 评论(0) 推荐(0) 编辑
上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 53 下一页