随笔分类 -  Level 2

上一页 1 ··· 4 5 6 7 8 9 10 11 12 下一页
摘要:Construct minimum number by reordering a given non-negative integer array. Arrange them such that they form the minimum number. Notice The result may 阅读全文
posted @ 2016-09-15 02:01 北叶青藤 阅读(376) 评论(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 北叶青藤 阅读(402) 评论(0) 推荐(0)
摘要:Given two strings S and T, determine if they are both one edit distance apart. 分析:https://segmentfault.com/a/1190000003906621 虽然我们可以用Edit Distance的解法, 阅读全文
posted @ 2016-08-06 12:42 北叶青藤 阅读(279) 评论(0) 推荐(0)
摘要:Given an Iterator class interface with methods: next() and hasNext(), design and implement a PeekingIterator that support the peek()operation -- it es 阅读全文
posted @ 2016-08-06 08:26 北叶青藤 阅读(241) 评论(0) 推荐(0)
摘要:Given two 1d vectors, implement an iterator to return their elements alternately. For example, given two 1d vectors: By calling next repeatedly until 阅读全文
posted @ 2016-08-06 06:14 北叶青藤 阅读(252) 评论(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)
摘要:H-Index I Given an array of citations (each citation is a non-negative integer) of a researcher, write a function to compute the researcher's h-index. 阅读全文
posted @ 2016-08-05 11:06 北叶青藤 阅读(198) 评论(0) 推荐(0)
摘要:Given a string S, you are allowed to convert it to a palindrome by adding characters in front of it. Find and return the shortest palindrome you can f 阅读全文
posted @ 2016-08-05 08:11 北叶青藤 阅读(129) 评论(0) 推荐(0)
摘要:Implement an iterator to flatten a 2d vector. For example, Given 2d vector = By calling next repeatedly until hasNext returns false, the order of elem 阅读全文
posted @ 2016-08-05 04:04 北叶青藤 阅读(176) 评论(0) 推荐(0)
摘要:Verify Preorder Sequence in Binary Search Tree \Given an array of numbers, verify whether it is the correct preorder traversal sequence of a binary se 阅读全文
posted @ 2016-08-05 01:27 北叶青藤 阅读(606) 评论(0) 推荐(0)
摘要:A group of two or more people wants to meet and minimize the total travel distance. You are given a 2D grid of values 0 or 1, where each 1 marks the h 阅读全文
posted @ 2016-08-05 00:34 北叶青藤 阅读(262) 评论(0) 推荐(0)
摘要:Given a binary tree, find the length of the longest consecutive sequence path (连续的路径,不是从小到大). The path refers to any sequence of nodes from some start 阅读全文
posted @ 2016-08-04 22:40 北叶青藤 阅读(249) 评论(0) 推荐(0)
摘要:Additive number is a string whose digits can form additive sequence. A valid additive sequence should contain at least three numbers. Except for the f 阅读全文
posted @ 2016-08-04 09:12 北叶青藤 阅读(194) 评论(0) 推荐(0)
摘要:Given a binary tree, return the vertical order traversal of its nodes' values. (ie, from top to bottom, column by column). If two nodes are in the sam 阅读全文
posted @ 2016-08-04 04:19 北叶青藤 阅读(328) 评论(0) 推荐(0)
摘要:Given a string array words, find the maximum value of length(word[i]) * length(word[j]) where the two words do not share common letters. You may assum 阅读全文
posted @ 2016-08-04 01:03 北叶青藤 阅读(192) 评论(0) 推荐(0)
摘要:Given a range [m, n] where 0 <= m <= n <= 2147483647, return the bitwise AND of all numbers in this range, inclusive. For example, given the range [5, 阅读全文
posted @ 2016-08-03 07:19 北叶青藤 阅读(170) 评论(0) 推荐(0)
摘要:Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom. For exa 阅读全文
posted @ 2016-08-03 04:48 北叶青藤 阅读(147) 评论(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)
摘要:There are n bulbs that are initially off. You first turn on all the bulbs. Then, you turn off every second bulb. On the third round, you toggle every 阅读全文
posted @ 2016-08-02 12:59 北叶青藤 阅读(184) 评论(0) 推荐(0)
摘要:Given a set of distinct positive integers, find the largest subset such that every pair (Si, Sj) of elements in this subset satisfies: Si % Sj = 0 or 阅读全文
posted @ 2016-08-02 10:27 北叶青藤 阅读(189) 评论(0) 推荐(0)

上一页 1 ··· 4 5 6 7 8 9 10 11 12 下一页