验证大小中括号是否成对闭合匹配 Valid Parentheses 验证大小中括号是否成对闭合匹配。 Given a string containing just the characters ‘(̵…
分类:LeetCode
九宫格键盘输入
九宫格键盘输入 Letter Combinations of a Phone Number 给定一个数字字符串,返回数字可能代表的所有可能的字母组合。 数字到字母的映射(就像九宫格电话按钮一样)如下图。 Given a …
三元组相加获得结果最接近target
三元组相加获得结果最接近target 3SumClosest 给定一个数组,选择三个元素相加,结果必须为所有三元组中最接近target的值,返回这个三元组的和。 Given an array S of n integer…
不使用任何额外变量判断回文数字
不使用任何额外变量判断回文数字 Palindrome Number Determine whether an integer is a palindrome. Do this without extra space. N…
leetcode讲解--94. Binary Tree Inorder Traversal
94. Binary Tree Inorder Traversal Given a binary tree, return the inorder traversal of its nodes’ values…
Distinct Subsequences
Problem Given a string S and a string T, count the number of distinct subsequences of T in S. A subsequence of…
Largest Rectangle in Histogram
Problem Given n non-negative integers representing the histogram’s bar height where the width of each ba…
448. Find All Numbers Disappeared in an Array
原题 Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others ap…
[LeetCode By Go 44]506. Relative Ranks
题目 Given scores of N athletes, find their relative ranks and the people with the top three highest scores, who…
[LeetCode By Go 65]594. Longest Harmonious Subsequence
题目 We define a harmonious array is an array where the difference between its maximum value and its minimum val…
[LeetCode By Go 77]53. Maximum Subarray
题目 Find the contiguous subarray within an array (containing at least one number) which has the largest sum. Fo…
[LeetCode By Go 69]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 …