随笔分类 -  Google

摘要:Missing Ranges You are given an inclusive range [lower, upper] and a sorted unique integer array nums, where all elements are in the inclusive range. 阅读全文
posted @ 2016-08-03 08:27 北叶青藤 阅读(194) 评论(0) 推荐(0)
摘要:Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; } Populate each next pointer to point to its ne 阅读全文
posted @ 2016-08-03 02:31 北叶青藤 阅读(287) 评论(0) 推荐(0)
摘要:Given a string, find the longest substring that contains only two unique characters. For example, given "abcbbbbcccbdddadacb", the longest substring t 阅读全文
posted @ 2016-08-03 01:05 北叶青藤 阅读(304) 评论(0) 推荐(0)
摘要:Given two numbers represented as strings, return multiplication of the numbers as a string. Note: The numbers can be arbitrarily large and are non-neg 阅读全文
posted @ 2016-08-02 00:45 北叶青藤 阅读(177) 评论(0) 推荐(0)
摘要:Nested List Weight Sum I Given a nested list of integers, return the sum of all integers in the list weighted by their depth. Each element is either a 阅读全文
posted @ 2016-08-01 02:55 北叶青藤 阅读(327) 评论(0) 推荐(0)
摘要:Given a list of unique words. Find all pairs of distinct indices (i, j) in the given list, so that the concatenation of the two words, i.e.words[i] + 阅读全文
posted @ 2016-08-01 00:32 北叶青藤 阅读(353) 评论(0) 推荐(0)
摘要:Design an algorithm to encode a list of strings to a string. The encoded string is then sent over the network and is decoded back to the original list 阅读全文
posted @ 2016-07-28 06:43 北叶青藤 阅读(229) 评论(0) 推荐(0)
摘要:Convert a non-negative integer to its english words representation. Given input is guaranteed to be less than 231 - 1. For example, 123 -> "One Hundre 阅读全文
posted @ 2016-07-28 05:27 北叶青藤 阅读(240) 评论(0) 推荐(0)
摘要:Design a Tic-tac-toe game that is played between two players on a n x n grid. You may assume the following rules: A move is guaranteed to be valid and 阅读全文
posted @ 2016-07-27 21:01 北叶青藤 阅读(179) 评论(0) 推荐(0)
摘要:You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that you nee 阅读全文
posted @ 2016-07-27 05:49 北叶青藤 阅读(220) 评论(0) 推荐(0)
摘要:Given a non-empty array of integers, return the k most frequent elements. For example,Given [1,1,1,2,2,3] and k = 2, return [1,2]. 分析: http://blog.csd 阅读全文
posted @ 2016-07-27 01:24 北叶青藤 阅读(213) 评论(0) 推荐(0)
摘要:Given n balloons, indexed from 0 to n-1. Each balloon is painted with a number on it represented by array nums. You are asked to burst all the balloon 阅读全文
posted @ 2016-07-24 04:29 北叶青藤 阅读(233) 评论(0) 推荐(0)
摘要:Regular Expression Matching Implement regular expression matching with support for '.' and '*'. '.' Matches any single character. '*' Matches zero or 阅读全文
posted @ 2016-07-23 02:51 北叶青藤 阅读(213) 评论(0) 推荐(0)
摘要:Suppose a sorted array is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2). You are given a target va 阅读全文
posted @ 2016-07-22 10:59 北叶青藤 阅读(170) 评论(0) 推荐(0)
摘要:Given two arrays of length m and n with digits 0-9 representing two numbers. Create the maximum number of length k <= m + n from digits of the two. Th 阅读全文
posted @ 2016-07-22 04:15 北叶青藤 阅读(238) 评论(0) 推荐(0)
摘要:Given a nested list of integers, implement an iterator to flatten it. Each element is either an integer, or a list -- whose elements may also be integ 阅读全文
posted @ 2016-07-22 00:28 北叶青藤 阅读(213) 评论(0) 推荐(0)
摘要:Median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean of the two 阅读全文
posted @ 2016-07-21 02:46 北叶青藤 阅读(200) 评论(0) 推荐(0)
摘要:Given n points on a 2D plane, find the maximum number of points that lie on the same straight line. Example Given 4 points: (1,2), (3,6), (0,0), (1,3) 阅读全文
posted @ 2016-07-21 01:28 北叶青藤 阅读(261) 评论(0) 推荐(0)
摘要:Given an array of n integer with duplicate number, and a moving window(size k), move the window at each iteration from the start of the array, find th 阅读全文
posted @ 2016-07-20 05:33 北叶青藤 阅读(160) 评论(0) 推荐(0)
摘要:Given a 2D boolean matrix filled with False and True, find the largest rectangle containing all True and return its area. Given a 2D boolean matrix fi 阅读全文
posted @ 2016-07-19 11:20 北叶青藤 阅读(163) 评论(0) 推荐(0)