Java
hareyukai
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
108 Convert Sorted Array to Binary Search Tree
Given an array where elements are sorted in ascending order, convert it to a height balanced BST. For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the...原创 2018-04-19 14:04:58 · 167 阅读 · 0 评论 -
747 Largest Number At Least Twice of Others
In a given integer array nums, there is always exactly one largest element. Find whether the largest element in the array is at least twice as much as every other number in the array. If it is, retu...原创 2018-04-21 00:11:53 · 196 阅读 · 0 评论 -
671 Second Minimum Node In a Binary Tree
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. If the node has two sub-nodes, then this node’s va...原创 2018-04-21 00:00:13 · 174 阅读 · 0 评论 -
458 Poor Pigs
There are 1000 buckets, one and only one of them contains poison, the rest are filled with water. They all look the same. If a pig drinks that poison it will die within 15 minutes. What is the minimum...原创 2018-04-20 23:47:37 · 164 阅读 · 0 评论 -
107 Binary Tree Level Order Traversal II
Given a binary tree, return the bottom-up level order traversal of its nodes’ values. (ie, from left to right, level by level from leaf to root). For example: Given binary tree [3,9,20,null,null,15,...原创 2018-04-20 20:21:22 · 155 阅读 · 0 评论 -
674 Longest Continuous Increasing Subsequence
Given an unsorted array of integers, find the length of longest continuous increasing subsequence (subarray). Example 1: Input: [1,3,5,4,7] Output: 3 Explanation: The longest continuous increasing...原创 2018-04-20 19:33:37 · 153 阅读 · 0 评论 -
121 Best Time to Buy and Sell Stock
Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transaction (i.e., buy one and sell one share of the stock),...原创 2018-04-20 19:27:20 · 183 阅读 · 0 评论 -
746 Min Cost Climbing Stairs
On a staircase, the i-th step has some non-negative cost cost[i] assigned (0 indexed). Once you pay the cost, you can either climb one or two steps. You need to find minimum cost to reach the top of ...原创 2018-04-20 18:56:59 · 152 阅读 · 0 评论 -
504 Base 7
Given an integer, return its base 7 string representation. Example 1: Input: 100 Output: “202” Example 2: Input: -7 Output: “-10” Note: The input will be in range of [-1e7, 1e7]. class Solut...原创 2018-04-19 15:39:47 · 157 阅读 · 0 评论 -
541 Reverse String II
Given a string and an integer k, you need to reverse the first k characters for every 2k characters counting from the start of the string. If there are less than k characters left, reverse all of them...原创 2018-04-19 15:30:13 · 149 阅读 · 0 评论 -
744 Find Smallest Letter Greater Than Target
Given a list of sorted characters letters containing only lowercase letters, and given a target letter target, find the smallest element in the list that is larger than the given target. Letters also...原创 2018-04-19 14:55:55 · 160 阅读 · 0 评论 -
350 Intersection of Two Arrays II
Given two arrays, write a function to compute their intersection. Example: Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2, 2]. Note: Each element in the result should appear as many times a...原创 2018-04-19 14:33:38 · 143 阅读 · 0 评论
分享