上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 27 下一页
摘要: Given a non-empty special binary tree consisting of nodes with the non-negative value, where each node in this tree has exactly twoor zero sub-node. If the node has two sub-nodes, then this node's val... 阅读全文
posted @ 2017-09-10 17:40 xiejunzhao 阅读(636) 评论(0) 推荐(0)
摘要: Given an unsorted array of integers, find the length of longest continuous increasing subsequence.Example 1:Input: [1,3,5,4,7] Output: 3 Explanation: The longest continuous increasing subsequence is [... 阅读全文
posted @ 2017-09-10 17:31 xiejunzhao 阅读(267) 评论(0) 推荐(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 need to change the root of the tree, so the result... 阅读全文
posted @ 2017-09-10 17:31 xiejunzhao 阅读(1199) 评论(0) 推荐(0)
摘要: Winter is coming! Your first job during the contest is to design a standard heater with fixed warm radius to warm all the houses.Now, you are given positions of houses and heaters on a horizontal line... 阅读全文
posted @ 2017-09-02 00:23 xiejunzhao 阅读(204) 评论(0) 推荐(0)
摘要: Given a sorted array consisting of only integers where every element appears twice except for one element which appears once. Find this single element that appears only once.Example 1:Input: [1,1,2,3,... 阅读全文
posted @ 2017-08-28 23:22 xiejunzhao 阅读(230) 评论(0) 推荐(0)
摘要: Given an array with n integers, your task is to check if it could become non-decreasing by modifying at most 1 element.We define an array is non-decreasing if array[i] nums[i + 1] and nums[i] < nums[... 阅读全文
posted @ 2017-08-27 22:48 xiejunzhao 阅读(1275) 评论(0) 推荐(0)
摘要: Suppose you have a random list of people standing in a queue. Each person is described by a pair of integers (h, k), where h is the height of the person and k is the number of people in front of this ... 阅读全文
posted @ 2017-08-26 16:23 xiejunzhao 阅读(340) 评论(0) 推荐(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 average gray scale (rounding down) of all the 8 surro... 阅读全文
posted @ 2017-08-26 00:41 xiejunzhao 阅读(225) 评论(0) 推荐(0)
摘要: You need to find the largest value in each row of a binary tree.Example:Input: 1 / \ 3 2 / \ \ 5 3 9 Output: [1, 3, 9] 题意:找出二叉树一层的最大值解法:用BFS的方式遍历每... 阅读全文
posted @ 2017-08-19 20:56 xiejunzhao 阅读(590) 评论(0) 推荐(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 original place.The move sequence is represented by a... 阅读全文
posted @ 2017-08-14 22:23 xiejunzhao 阅读(207) 评论(0) 推荐(0)
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 27 下一页