09 2017 档案

摘要:Implement a MapSum class with insert, and sum methods. For the method insert, you'll be given a pair of (string, integer). The string represents the k 阅读全文
posted @ 2017-09-30 23:54 Grandyang 阅读(4057) 评论(3) 推荐(0) 编辑
摘要:Implement a magic directory with buildDict, and search methods. For the method buildDict, you'll be given a list of non-repetitive words to build a di 阅读全文
posted @ 2017-09-29 21:52 Grandyang 阅读(4691) 评论(1) 推荐(0) 编辑
摘要:Given an unsorted array of integers, find the length of longest continuous increasing subsequence. Example 1: Example 2: Note: Length of the array wil 阅读全文
posted @ 2017-09-28 22:30 Grandyang 阅读(5078) 评论(0) 推荐(0) 编辑
摘要:Given an unsorted array of integers, find the number of longest increasing subsequence. Example 1: Input: [1,3,5,4,7] Output: 2 Explanation: The two l 阅读全文
posted @ 2017-09-27 21:06 Grandyang 阅读(10441) 评论(3) 推荐(1) 编辑
摘要:There is a room with n lights which are turned on initially and 4 buttons on the wall. After performing exactly m unknown operations towards buttons, 阅读全文
posted @ 2017-09-26 10:53 Grandyang 阅读(5631) 评论(5) 推荐(0) 编辑
摘要:Given a non-empty special binary tree consisting of nodes with the non-negative value, where each node in this tree has exactly two or zero sub-node. 阅读全文
posted @ 2017-09-25 05:04 Grandyang 阅读(7039) 评论(3) 推荐(0) 编辑
摘要:Given a non-negative integer, you could swap two digits at most once to get the maximum valued number. Return the maximum valued number you could get. 阅读全文
posted @ 2017-09-24 01:29 Grandyang 阅读(9832) 评论(4) 推荐(0) 编辑
摘要:Given a binary search tree and the lowest and highest boundaries as L and R, trim the tree so that all its elements lies in [L, R] (R >= L). You might 阅读全文
posted @ 2017-09-23 22:18 Grandyang 阅读(6370) 评论(1) 推荐(0) 编辑
摘要:Given two integers n and k, you need to construct a list which contains n different positive integers ranging from 1 to n and obeys the following requ 阅读全文
posted @ 2017-09-22 23:50 Grandyang 阅读(5023) 评论(0) 推荐(0) 编辑
摘要:If the depth of a tree is smaller than 5, then this tree can be represented by a list of three-digits integers. For each integer in this list: Given a 阅读全文
posted @ 2017-09-21 20:40 Grandyang 阅读(7074) 评论(0) 推荐(0) 编辑
摘要:Given an array with n integers, your task is to check if it could become non-decreasing by modifying at most 1element. We define an array is non-decre 阅读全文
posted @ 2017-09-20 22:26 Grandyang 阅读(10421) 评论(1) 推荐(0) 编辑
摘要:Given a binary tree with n nodes, your task is to check if it's possible to partition the tree to two trees which have the equal sum of values after r 阅读全文
posted @ 2017-09-19 10:14 Grandyang 阅读(5068) 评论(2) 推荐(0) 编辑
摘要:Given a binary tree, write a function to get the maximum width of the given tree. The width of a tree is the maximum width among all levels. The binar 阅读全文
posted @ 2017-09-18 00:05 Grandyang 阅读(11973) 评论(5) 推荐(0) 编辑
摘要:Given a 2D integer matrix M representing the gray scale of an image, you need to design a smoother to make the gray scale of each cell becomes the ave 阅读全文
posted @ 2017-09-17 13:38 Grandyang 阅读(5191) 评论(1) 推荐(0) 编辑
摘要:You are given an integer array sorted in ascending order (may contain duplicates), you need to split them into several subsequences, where each subseq 阅读全文
posted @ 2017-09-15 12:40 Grandyang 阅读(11496) 评论(2) 推荐(0) 编辑
摘要:Given a sorted array, two integers k and x, find the k closest elements to x in the array. The result should also be sorted in ascending order. If the 阅读全文
posted @ 2017-09-14 10:42 Grandyang 阅读(16523) 评论(11) 推荐(0) 编辑
摘要:Initially, there is a Robot at position (0, 0). Given a sequence of its moves, judge if this robot makes a circle, which means it moves back to the or 阅读全文
posted @ 2017-09-13 13:20 Grandyang 阅读(3033) 评论(0) 推荐(0) 编辑
摘要:You are given an integer array nums with no duplicates. A maximum binary tree can be built recursively from nums using the following algorithm: Create 阅读全文
posted @ 2017-09-13 03:27 Grandyang 阅读(7772) 评论(1) 推荐(0) 编辑
摘要:Given a Binary Search Tree and a target number, return true if there exist two elements in the BST such that their sum is equal to the given target. E 阅读全文
posted @ 2017-09-12 03:42 Grandyang 阅读(9408) 评论(2) 推荐(1) 编辑
摘要:Given the root of a binary tree, return all duplicate subtrees. For each kind of duplicate subtrees, you only need to return the root node of any one  阅读全文
posted @ 2017-09-10 06:41 Grandyang 阅读(8891) 评论(19) 推荐(1) 编辑
摘要:Print a binary tree in an m*n 2D string array following these rules: Example 1: Example 2: Example 3: Note: The height of binary tree is in the range 阅读全文
posted @ 2017-09-07 12:37 Grandyang 阅读(6059) 评论(0) 推荐(0) 编辑

Fork me on GitHub