1. 题目 Given a sorted array and a target value, return the index if the target is found. If not, return the ind…
分类:LeetCode题目解答
22. Generate Parentheses
22. Generate Parentheses 题目 Given n pairs of parentheses, write a function to generate all combinations of wel…
LeetCode | Binary Tree Maximum Path Sum
题目: Given a binary tree, find the maximum path sum. The path may start and end at any node in the tree. For ex…
LeetCode 21. Merge Two Sorted Lists
题目 将两个排序链表合并为一个新的排序链表 样例 给出 1->3->8->11->15->null,2->null, 返回 1->2->3->8->11->…
6. ZigZag Conversion
6. ZigZag Conversion 题目 The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows l…
[LeetCode] Search a 2D Matrix II 搜索一个二维矩阵之二,Search a 2D Matrix 搜索一个二维矩阵
Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the followin…
[LeetCode] Sparse Matrix Multiplication 稀疏矩阵相乘
Given two sparse matrices A and B, return the result of AB. You may assume that A‘s column number…
【leetcode】43. Multiply Strings 大数乘法
1. 题目 Given two numbers represented as strings, return multiplication of the numbers as a string. Note:The num…
[LeetCode] Balanced Binary Tree 平衡二叉树
Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tre…
[LeetCode] Most Frequent Subtree Sum 出现频率最高的子树和
Given the root of a tree, you are asked to find the most frequent subtree sum. The subtree sum of a nod…
[LeetCode] Longest Line of Consecutive One in Matrix 矩阵中最长的连续1
Given a 01 matrix M, find the longest line of consecutive one in the matrix. The line could be hor…
LeetCode | Valid Palindrome
题目: Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cas…