Given the root node of a binary search tree (BST) and a value. You need to find the node in the BST tha…
分类:LeetCode题目解答
LeetCode | Unique Binary Search Trees
题目: Given n, how many structurally unique BST’s (binary search trees) that store values 1…
【leetcode】66. Plus One 用单个数字列表表示的数进行加一返回同样的数字列表形式
1. 题目 Given a non-negative number represented as an array of digits, plus one to the number. The digits are st…
81. Search in Rotated Sorted Array II
81. Search in Rotated Sorted Array II 题目 Follow up for "Search in Rotated Sorted Array": What if duplicates ar…
71. Simplify Path
71. Simplify Path 题目 Given an absolute path for a file (Unix-style), simplify it. For example, path = "/home/"…
[LeetCode] Find All Duplicates in an Array 找出数组中所有重复项
Given an array of integers, 1 ≤ a[i] ≤ n (n = size of array), some elements appear …
[LeetCode] Regular Expression Matching 正则表达式匹配,Wildcard Matching
Given an input string (s) and a pattern (p), implement regular expression matching with support for&nbs…
[LeetCode] First Bad Version 第一个坏版本
You are a product manager and currently leading a team to develop a new product. Unfortunately, the lat…
[LeetCode] Design Twitter 设计推特
Design a simplified version of Twitter where users can post tweets, follow/unfollow another user and is…
LeetCode 075 Sort Colors
题目描述 Given an array with n objects colored red, white or blue, sort them so that objects of the same color are…
【leetcode】61. Rotate List
1. 题目 Given a list, rotate the list to the right by k places, where k is non-negative. For example:Given 1->…
【leetcode】32. Longest Valid Parentheses 最长的有效匹配括号子串长度
1. 题目 Given a string containing just the characters ‘(‘ and ‘)’, find the length of th…