题目: Write an efficient algorithm that searches for a value in an m x n matrix. This matrix…
分类:LeetCode
[Leetcode] Binary Tree Maximum Path Sum 二叉树最大路径和
Binary Tree Maximum Path Sum Given a binary tree, find the maximum path sum. The path may start and end at any…
344. 反转字符串
一、题目原型: 编写一个函数,其作用是将输入的字符串反转过来。 二、示例剖析: 示例 1: 输入: "hello" 输出: "olleh" 示例 2: 输入: "A man, a plan, a canal: Panam…
经由过程几道问题进修二叉搜刮树
二叉树人人都晓得,二叉搜刮树满足以下特性: 节点的左子树只包括小于当前节点的数 节点的右子树只包括大于当前节点的数 一切左子树和右子树本身必需也是二叉搜刮树 二叉搜刮树也叫二叉排序树,中序遍历二叉搜刮树的效果就是一次递增…
56. Merge Intervals
56. Merge Intervals 题目 Given a collection of intervals, merge all overlapping intervals. For example, Given [1…
[LeetCode] Ugly Number 丑陋数
Write a program to check whether a given number is an ugly number. Ugly numbers are positive numbers wh…
LeetCode | Implement strStr()
题目: Implement strStr(). Returns a pointer to the first occurrence of needle in haystack, or null if …
796. Rotate String
题目地址:https://leetcode.com/problems/rotate-string/description/ 大意:看题目的名字就应该能看出来意思了。就是看B是不是由A“旋转”而成的,即A的一部分放到最前面…
Day 23.Jewels and Stones(771)
问题描述:You’re given strings J representing the types of stones that are jewels, and S representing the sto…
Day7. Contains Duplicate(217)
问题描述 Given an array of integers, find if the array contains any duplicates. Your function should return true i…
[LeetCode] Largest Number 最大组合数
Given a list of non negative integers, arrange them such that they form the largest number. For example…
[LeetCode] Pour Water 倒水
We are given an elevation map, heights[i] representing the height of the terrain at that inde…