Given a grid where each entry is only 0 or 1, find the number of corner rectangles. A corner recta…
分类:LeetCode
[LeetCode] Cracking the Safe 破解密码
There is a box protected by a password. The password is n digits, where each letter can be on…
300. Longest Increasing Subsequence
Given an unsorted array of integers, find the length of longest increasing subsequence.Example: Input: [10,9,2…
[Leetcode] Implement Trie 实现前缀树
Implement Trie Implement a trie with insert, search, and startsWith methods. Note: You may assume that all inp…
力扣(LeetCode)21
题目地址:https://leetcode-cn.com/probl…题目描述:将两个有序链表合并为一个新的有序链表并返回。新链表是通过拼接给定的两个链表的所有节点组成的。 解答:递归思想。若两者其中有一个为…
LeetCode | Valid Palindrome(有效的回文串)
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. …
LeetCode算法题-Best Time to Buy and Sell Stock II
这是悦乐书的第173次更新,第175篇原创 01 看题和准备 今天介绍的是LeetCode算法题中Easy级别的第32题(顺位题号是122)。假设有一个数组,其中第i个元素是第i天给定股票的价格。设计算法以找到最大利润。…
Leetcode PHP题解--D30 728. Self Dividing Numbers
728. Self Dividing Numbers 题目链接 728. Self Dividing Numbers 题目分析 如果一个数字能被其中的每一位整除,那么这个数字被称为自整除数。 例如,数字128。128%1…
Leetcode 157. Read N Characters Given Read4
The API: int read4(char *buf) reads 4 characters at a time from a file. The return value is the actual number …
LeetCode[7] - First Bad Version
这个挺直接的,也被李特标了EASY. 就是在1~n里面找第一个出错点。其实就是搜一个数字i(同时用isBadVersion(i))检查这个数字是否报错。那搜index的活,直接binary search就好了。 注意特别…
[LeetCode By Go 47]242. Valid Anagram
题目 Given two strings s and t, write a function to determine if t is an anagram of s. For example, s = “a…
[LeetCode] Longest Absolute File Path 最长的绝对文件路径
Suppose we abstract our file system by a string in the following manner: The string "dir\n\tsubdir…