Find the length of the longest substring T of a given string (consists of lowercase letters only) such …
分类:LeetCode题目解答
[LeetCode] Falling Squares 下落的方块
On an infinite number line (x-axis), we drop given squares in the order they are given. The i-th s…
[LeetCode] Next Greater Element II 下一个较大的元素之二
Given a circular array (the next element of the last element is the first element of the array), print …
219. Contains Duplicate II
Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the ar…
【leetcode】49. Group Anagrams 字母组合相同的单词聚合
1. 题目 Given an array of strings, group anagrams together. For example, given: [“eat”, “tea…
[LeetCode] Lowest Common Ancestor of a Binary Search Tree 二叉搜索树的最小共同父节点,Validate Binary Search Tree 验证二叉搜索树,Recover Binary Search Tree 复原二叉搜索树,Binary Search Tree Iterator 二叉搜索树迭代器,Unique Binary Search Trees 独一无二的二叉搜索树,Unique Binary Search Trees II 独一无二的二叉搜索树之二,Convert Sorted Array to Binary Search Tree 将有序数组转为二叉搜索树,Convert Sorted List to Binary Search Tree 将有序链表转为二叉搜索树,Kth Smallest Element in a BST 二叉搜索树中的第K小的元素
Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST. …
[LeetCode] Maximum Gap 求最大间距
Given an unsorted array, find the maximum difference between the successive elements in its sorted form…
[LeetCode] Add and Search Word - Data structure design 添加和查找单词-数据结构设计
Design a data structure that supports the following two operations: void addWord(word) bool search(word…
[LeetCode] Strobogrammatic Number II 对称数之二
A strobogrammatic number is a number that looks the same when rotated 180 degrees (looked at upside dow…
[LeetCode] Min Stack 最小栈
Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. push(…
[LeetCode] Partition Equal Subset Sum 相同子集和分割
Given a non-empty array containing only positive integers, find if the array can be partitioned into tw…
[LeetCode] 01 Matrix 零一矩阵
Given a matrix consists of 0 and 1, find the distance of the nearest 0 for each cell. The distance betw…