Design a data structure that supports the following two operations:void addWord(word)bool search(word)search(w…
分类:LeetCode题目解答
【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] 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 …
[LeetCode] Longest Univalue Path 最长相同值路径
Given a binary tree, find the length of the longest path where each node in the path has the same value…
LeetCode | Regular Expression Matching
题目: Implement regular expression matching with support for '.' and '*'. '.' Matches any single …
LeetCode | Minimum Window Substring
题目: Given a string S and a string T, find the minimum window in S which will contain all the characters in T i…
41. First Missing Positive
41. First Missing Positive 题目 Given an unsorted integer array, find the first missing positive integer. For ex…
[LeetCode] Subsets 子集合,Subsets II 子集合之二
Given a set of distinct integers, S, return all possible subsets. Note: Elements in a subset must …
【leetcode】100. Same Tree
1. 题目 Given two binary trees, write a function to check if they are equal or not. Two binary trees are conside…
[LeetCode] Divide Two Integers 两数相除
Divide two integers without using multiplication, division and mod operator. If it is overflow, return …