随笔分类 -  Level 1

摘要:The code base version is an integer start from 1 to n. One day, someone committed a bad version in the code case, so it caused this version and the fo 阅读全文
posted @ 2016-07-16 05:12 北叶青藤 阅读(185) 评论(0) 推荐(0)
摘要:Add Two Numbers I You have two numbers represented by a linked list, where each node contains a single digit. The digits are stored in reverse order, 阅读全文
posted @ 2016-07-16 00:11 北叶青藤 阅读(229) 评论(0) 推荐(0)
摘要:Given n pieces of wood with length L[i] (integer array). Cut them into small pieces to guarantee you could have equal or more than k pieces with the s 阅读全文
posted @ 2016-07-15 03:39 北叶青藤 阅读(248) 评论(0) 推荐(0)
摘要:Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longes 阅读全文
posted @ 2016-07-14 21:58 北叶青藤 阅读(149) 评论(0) 推荐(0)
摘要:Count how many 1 in binary representation of a 32-bit integer. Count how many 1 in binary representation of a 32-bit integer. Count how many 1 in bina 阅读全文
posted @ 2016-07-14 08:30 北叶青藤 阅读(163) 评论(0) 推荐(0)
摘要:Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string. If the last word 阅读全文
posted @ 2016-07-13 11:13 北叶青藤 阅读(161) 评论(0) 推荐(0)
摘要:Check if two binary trees are identical. Identical means the two binary trees have the same structure and every identical position has the same value. 阅读全文
posted @ 2016-07-12 07:23 北叶青藤 阅读(256) 评论(0) 推荐(0)
摘要:Factory is a design pattern in common usage. Implement a ShapeFactory that can generate correct shape. You can assume that we have only tree different 阅读全文
posted @ 2016-07-12 06:37 北叶青藤 阅读(540) 评论(0) 推荐(0)
摘要:Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements. Notice You must 阅读全文
posted @ 2016-07-11 21:39 北叶青藤 阅读(174) 评论(0) 推荐(0)
摘要:Given two array of integers(the first array is array A, the second array is arrayB), now we are going to find a element in array A which is A[i], and 阅读全文
posted @ 2016-07-10 12:45 北叶青藤 阅读(329) 评论(0) 推荐(0)
摘要:Invert a binary tree. Invert a binary tree. Invert a binary tree. Example 1 1 / \ / \ 2 3 => 3 2 / \ 4 4 1 /** 2 * Definition of TreeNode: 3 * public 阅读全文
posted @ 2016-07-10 12:32 北叶青藤 阅读(132) 评论(0) 推荐(0)
摘要:Implement int sqrt(int x). Compute and return the square root of x. Have you met this question in a real interview? Yes Example sqrt(3) = 1 sqrt(4) = 阅读全文
posted @ 2016-07-10 12:29 北叶青藤 阅读(203) 评论(0) 推荐(0)
摘要:Given a dictionary, find all of the longest words in the dictionary. Given a dictionary, find all of the longest words in the dictionary. Given a dict 阅读全文
posted @ 2016-07-10 07:12 北叶青藤 阅读(233) 评论(0) 推荐(0)
摘要:Implement a stack with min() function, which will return the smallest number in the stack. It should support push, pop and min operation all in O(1) c 阅读全文
posted @ 2016-07-09 07:59 北叶青藤 阅读(188) 评论(0) 推荐(0)
摘要:Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path. 阅读全文
posted @ 2016-07-08 05:14 北叶青藤 阅读(157) 评论(0) 推荐(0)
摘要:Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level). Example Given binary tree {3,9,2 阅读全文
posted @ 2016-07-07 12:30 北叶青藤 阅读(139) 评论(0) 推荐(0)
摘要:Compare two strings A and B, determine whether A contains all of the characters in B. The characters in string A and B are all Upper Case letters. Not 阅读全文
posted @ 2016-07-06 12:17 北叶青藤 阅读(170) 评论(0) 推荐(0)
摘要:Given a string and an offset, rotate string by offset. (rotate from left to right) Given a string and an offset, rotate string by offset. (rotate from 阅读全文
posted @ 2016-07-06 08:21 北叶青藤 阅读(234) 评论(0) 推荐(0)
摘要:Unique Paths I A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The robot can only move either down or 阅读全文
posted @ 2016-07-06 07:39 北叶青藤 阅读(164) 评论(0) 推荐(0)
摘要:Count the number of k's between 0 and n. k can be 0 - 9. Count the number of k's between 0 and n. k can be 0 - 9. Count the number of k's between 0 an 阅读全文
posted @ 2016-07-06 02:33 北叶青藤 阅读(406) 评论(0) 推荐(0)