You are given two linked lists representing two non-negative numbers. The digits are stored in reverse …
分类:LeetCode
[LeetCode] Permutations 全排列,Combinations,Combinations,Combinations
Given a collection of distinct integers, return all possible permutations. Example: Input: [1…
[LeetCode] Longest Substring with At Most K Distinct Characters 最多有K个不同字符的最长子串
Given a string, find the length of the longest substring T that contains at most k distinct characters.…
[LeetCode] K Empty Slots K个空槽
There is a garden with N slots. In each slot, there is a flower. The N flowers will…
75. Sort Colors
Given an array with n objects colored red, white or blue, sort them in-place so that objects of the same color…
211. Add and Search Word - Data structure design
Design a data structure that supports the following two operations:void addWord(word)bool search(word)search(w…
【leetcode】27. Remove Element 删除数组指定值的元素
1. 题目 Given an array and a value, remove all instances of that value in place and return the new length. Do no…
LeetCode | 4Sum(四个数的和)
Given an array S of n integers, are there elements a, b, c, and d …
561. Array Partition I
题目地址:https://leetcode.com/submissions/detail/160916288/ 大意:把一个元素个数是2n的数组,分成n组,要求这n组里面比较小的数的和相加,最大。初一看,比较难理解。 (…
[LeetCode] Different Ways to Add Parentheses 添加括号的不同方式,Unique Binary Search Trees II 独一无二的二叉搜索树之二
Given a string of numbers and operators, return all possible results from computing all the different p…
[LeetCode] Total Hamming Distance 全部汉明距离
The Hamming distance between two integers is the number of positions at which the correspondi…
[LeetCode] Fraction Addition and Subtraction 分数加减法
Given a string representing an expression of fraction addition and subtraction, you need to return the …