![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LeetCode
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 · 127 阅读 · 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 · 154 阅读 · 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 · 122 阅读 · 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 · 112 阅读 · 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 · 104 阅读 · 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 · 105 阅读 · 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 · 141 阅读 · 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 · 113 阅读 · 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 · 111 阅读 · 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 · 101 阅读 · 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 · 111 阅读 · 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 · 104 阅读 · 0 评论 -
771. Jewels and Stones
You’re given strings J representing the types of stones that are jewels, and S representing the stones you have. Each character in S is a type of stone you have. You want to know how many of the sto...原创 2019-02-24 10:03:06 · 106 阅读 · 0 评论