Given a data stream input of non-negative integers a1, a2, …, an, …, summarize the numbers …
分类:LeetCode题目解答
[LeetCode] Compare Version Numbers 版本比较
Compare two version numbers version1 and version2.If version1 > versio…
[LeetCode] Closest Binary Search Tree Value II 最近的二分搜索树的值之二
Given a non-empty binary search tree and a target value, find k values in the BST that are cl…
[LeetCode] Optimal Account Balancing 最优账户平衡
A group of friends went on holiday and sometimes lent each other money. For example, Alice paid for Bil…
[Leetcode] Majority Element 众数
Majority Element I Given an array of size n, find the majority element. The majority element is the element th…
300. 最长上升子序列
题目 给定一个无序的整数数组,找到其中最长上升子序列的长度。 示例: 输入: [10,9,2,5,3,7,101,18] 输出: 4 解释: 最长的上升子序列是 [2,3,7,101],它的长度是 4。 说明: 可能会有…
4. Median of Two Sorted Arrays(topK-logk)
4. Median of Two Sorted Arrays 题目 There are two sorted arrays nums1 and nums2 of size m and n respectively. Fi…
[LeetCode] Sort Transformed Array 变换数组排序
Given a sorted array of integers nums and integer values a, b and c. Apply a function of the form f(x) …
LeetCode 300 Longest Increasing Subsequence
题目描述 Given an unsorted array of integers, find the length of longest increasing subsequence. For example, Give…
力扣(LeetCode)31
题目地址:https://leetcode-cn.com/probl… 题目描述:实现获取下一个排列的函数,算法需要将给定数字序列重新排列成字典序中下一个更大的排列。 如果不存在下一个更大的排列,则将数字重新…
55. Jump Game
55. Jump Game 题目 Given an array of non-negative integers, you are initially positioned at the first index of t…
[LeetCode] Longest Common Prefix 最长共同前缀
Write a function to find the longest common prefix string amongst an array of strings. If there is no c…