Given a collection of intervals, merge all overlapping intervals. For example, Given [1,3],[2,6],[8,10]…
分类:LeetCode题目解答
LeetCode 020 Valid Parentheses
题目描述 Given a string containing just the characters ‘(‘, ‘)’, ‘{‘, ‘}’, ‘[‘ and ‘]’, determine if the input str…
959. Regions Cut By Slashes
In a N x N grid composed of 1 x 1 squares, each 1 x 1 square consists of a /, , or blank space. These characte…
513. Find Bottom Left Tree Value
Given a binary tree, find the leftmost value in the last row of the tree. Example 1: Input: 2 / \ 1 3 Output: …
[Leetcode] Longest Substring with At Most 2 Distinct Characters
Longest Substring with At Most Two Distinct Characters 最新思路解法:https://yanjia.me/zh/2018/12/… Given a str…
力扣(LeetCode)934
题目地址:https://leetcode-cn.com/probl…题目描述:在给定的二维二进制数组 A 中,存在两座岛。(岛是由四面相连的 1 形成的一个最大组。) 现在,我们可以将 0 变为 1,以使两…
[Leetcode] Search a 2D Matrix 搜索二维矩阵
Search a 2D Matrix I Write an efficient algorithm that searches for a value in an m x n matrix. This matrix ha…
【leetcode】54. Spiral Matrix 矩阵的螺旋圈向内顺序展开为一维
1. 题目 Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.…
[LeetCode] Solve the Equation 解方程
Solve a given equation and return the value of x in the form of string “x=#value”…
LeetCode | String to Integer (atoi)
题目: Implement atoi to convert a string to an integer. Hint: Carefully consider all possible inp…
[LeetCode] Generate Parentheses 生成括号, Longest Valid Parentheses 最长有效括号
Given n pairs of parentheses, write a function to generate all combinations of well-formed pa…
[LeetCode] Path Sum II 二叉树路径之和之二
Given a binary tree and a sum, find all root-to-leaf paths where each path’s sum equals the given…