Design and implement a data structure for Least Recently Used (LRU) cache. It should support the f…
分类:LeetCode题目解答
[Leetcode] Plus One 加一
Plus One Given a non-negative number represented as an array of digits, plus one to the number. The digits are…
[LeetCode] Binary Search Tree Iterator 二叉搜索树迭代器
Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of…
[LeetCode] 3Sum Smaller 三数之和较小值
Given an array of n integers nums and a target, find the number of index tripl…
[LeetCode] Continuous Subarray Sum 连续的子数组之和
Given a list of non-negative numbers and a target integer k, write a function to check if the array has…
18. 4Sum
欢迎fork and star:Nowcoder-Repository-github 18. 4Sum 题目 Given an array S of n integers, are there elements a, b…
15. 3Sum
15. 3Sum 题目 Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all …
LeetCode 217 Contains Duplicate
题目描述 Given an array of integers, find if the array contains any duplicates. Your function should return true i…
[LeetCode] Median of Two Sorted Arrays 两个有序数组的中位数
There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the …
[LeetCode] Text Justification 文本左右对齐
Given an array of words and a length L, format the text such that each line has exactly L&nbs…
LeetCode | Search Insert Position
题目: Given a sorted array and a target value, return the index if the target is found. If not, return the index…
[Leetcode] Kth Smallest Element in a BST 二叉搜索树第k小节点
Kth Smallest Element in a BST Given a binary search tree, write a function kthSmallest to find the kth smalles…