随笔分类 -  Uber

摘要:Given a string that contains only digits 0-9 and a target value, return all possibilities to add binary operators (not unary) +, -, or *between the di 阅读全文
posted @ 2016-10-23 23:07 北叶青藤 阅读(233) 评论(0) 推荐(0)
摘要:Remove the minimum number of invalid parentheses in order to make the input string valid. Return all possible results. Note: The input string may cont 阅读全文
posted @ 2016-10-23 10:06 北叶青藤 阅读(270) 评论(0) 推荐(0)
摘要:You are given a m x n 2D grid initialized with these three possible values. -1 - A wall or an obstacle. 0 - A gate. INF - Infinity means an empty room 阅读全文
posted @ 2016-10-10 07:37 北叶青藤 阅读(193) 评论(0) 推荐(0)
摘要:According to the Wikipedia's article: "The Game of Life, also known simply as Life, is a cellular automaton devised by the British mathematician John 阅读全文
posted @ 2016-08-08 22:13 北叶青藤 阅读(401) 评论(0) 推荐(0)
摘要:The API: int read4(char *buf) reads 4 characters at a time from a file. The return value is the actual number of characters read. For example, it retu 阅读全文
posted @ 2016-08-08 10:11 北叶青藤 阅读(266) 评论(0) 推荐(0)
摘要:Given an array of words and a length L, format the text such that each line has exactly L characters and is fully (left and right) justified. You shou 阅读全文
posted @ 2016-08-06 01:47 北叶青藤 阅读(190) 评论(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 北叶青藤 阅读(325) 评论(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 北叶青藤 阅读(228) 评论(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 北叶青藤 阅读(212) 评论(0) 推荐(0)
摘要:Word Ladder I Given two words (start and end), and a dictionary, find the length of shortest transformation sequence from start to end, such that: Onl 阅读全文
posted @ 2016-07-18 07:03 北叶青藤 阅读(367) 评论(0) 推荐(0)
摘要:Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and put. get(key) - Get the 阅读全文
posted @ 2016-07-15 22:48 北叶青藤 阅读(377) 评论(0) 推荐(0)
摘要:Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining. 阅读全文
posted @ 2016-07-14 09:02 北叶青藤 阅读(241) 评论(0) 推荐(0)
摘要:Insert Intervals Given a non-overlapping interval list which is sorted by start point. Insert a new interval into it, make sure the list is still in o 阅读全文
posted @ 2016-07-14 03:57 北叶青藤 阅读(264) 评论(0) 推荐(0)
摘要:Determine whether a Sudoku is valid. The Sudoku board could be partially filled, where empty cells are filled with the character .. Notice A valid Sud 阅读全文
posted @ 2016-07-13 12:02 北叶青藤 阅读(208) 评论(0) 推荐(0)
摘要:Given a boolean 2D matrix, find the number of islands. Notice 0 is represented as the sea, 1 is represented as the island. If two 1 is adjacent, we co 阅读全文
posted @ 2016-07-13 10:39 北叶青藤 阅读(232) 评论(0) 推荐(0)
摘要:Given an unsorted integer array, find the first missing positive integer. Example Given [1,2,0] return 3,and [3,4,-1,1] return 2. 分析: 我们只需要把1到A.length 阅读全文
posted @ 2016-07-09 12:24 北叶青藤 阅读(208) 评论(0) 推荐(0)
摘要:Design an iterator over a binary search tree with the following rules: Elements are visited in ascending order (i.e. an in-order traversal) next() and 阅读全文
posted @ 2016-07-08 02:39 北叶青藤 阅读(167) 评论(0) 推荐(0)
摘要:For an array A, if i < j, and A [i] > A [j], called (A [i], A [j]) is a reverse pair.return total of reverse pairs in A. For an array A, if i < j, and 阅读全文
posted @ 2016-07-06 02:01 北叶青藤 阅读(219) 评论(0) 推荐(0)
摘要:Two Sum I Given an array of integers, find two numbers such that they add up to a specific target number. The function twoSum should return indices of 阅读全文
posted @ 2016-07-04 07:13 北叶青藤 阅读(323) 评论(0) 推荐(0)
摘要:Given an integers array A. Define B[i] = A[0] * ... * A[i-1] * A[i+1] * ... * A[n-1], calculate B WITHOUT divide operation. Example For A = [1, 2, 3], 阅读全文
posted @ 2016-07-01 11:05 北叶青藤 阅读(371) 评论(0) 推荐(0)