Candy There are N children standing in a line. Each child is assigned a rating value. You are giving candies t…
分类:LeetCode题目解答
[LeetCode] Basic Calculator II 基本计算器之二,Basic Calculator 基本计算器
Implement a basic calculator to evaluate a simple expression string. The expression string contains onl…
[LeetCode] Design TinyURL 设计精简URL地址
Note: For the coding companion problem, please see: Encode and Decode TinyURL. How would you desi…
[LeetCode] Maximum Sum of 3 Non-Overlapping Subarrays 三个非重叠子数组的最大和
In a given array nums of positive integers, find three non-overlapping subarrays with maximum…
[LeetCode] 1-bit and 2-bit Characters 一位和两位字符
We have two special characters. The first character can be represented by one bit 0. The second ch…
LeetCode | Search a 2D Matrix
题目: Write an efficient algorithm that searches for a value in an m x n matrix. This matrix…
[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…
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 …
[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…