题目: Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follo…
分类:LeetCode
[Leetcode] Wildcard Matching 通配符匹配
Wildcard Matching Implement wildcard pattern matching with support for ‘?’ and ‘*’. …
[array] leetcode - 33. Search in Rotated Sorted Array - Medium
leetcode – 33. Search in Rotated Sorted Array – Medium descrition Suppose an array sorted in ascen…
Leetcode PHP题解--D2 929. Unique Email Addresses
929. Unique Email Addresses 题目链接 929. Unique Email Addresses 题目分析 题目要求过滤重复的邮箱地址。最终返回不重复的用户名个数。 过滤规则是:邮箱名中的.要被忽…
2018-05-10 367. Valid Perfect Square
题意:给你一个正数,判断这个正数是不是完全平方数。 解题思路:“完全平方数” = 1 + 3 + 5 + 7 + 9 +… 1^2 = 1; 2^2 = 1 + 3 = (1 + 3) / 2 = 2 + 2…
[LeetCode] Reverse Linked List II 倒置链表之二
Reverse a linked list from position m to n. Do it in one-pass. Note: 1 ≤ m&nbs…
[LeetCode] Factorial Trailing Zeroes 求阶乘末尾零的个数
Given an integer n, return the number of trailing zeroes in n!. Note: Your solution shou…
[LeetCode] Shortest Word Distance III 最短单词距离之三
This is a follow up of Shortest Word Distance. The only difference is now word1 could be the same as wo…
[LeetCode] Maximum Length of Repeated Subarray 最长的重复子数组
Given two integer arrays A and B, return the maximum length of an subarray that appears in both arrays.…
[LeetCode] Reorganize String 重构字符串
Given a string S, check if the letters can be rearranged so that two characters that are adjacent …
LeetCode | Best Time to Buy and Sell Stock III
题目: Say you have an array for which the ith element is the price of a given stock on day i. Des…
198. House Robber
You are a professional robber planning to rob houses along a street. Each house has a certain amount of money …