题目描述 Given a 2D binary matrix filled with 0’s and 1’s, find the largest square containing all 1’s and return i…
分类:LeetCode题目解答
LeetCode 208 Implement Trie (Prefix Tree)
题目描述 Implement a trie with insert, search, and startsWith methods. Note: You may assume that all inputs are co…
【leetcode】87. Scramble String 字符串树形颠倒匹配
1. 题目 Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings r…
746. 使用最小花费爬楼梯
题目 数组的每个索引做为一个阶梯,第 i个阶梯对应着一个非负数的体力花费值 cost[i](索引从0开始)。 每当你爬上一个阶梯你都要花费对应的体力花费值,然后你可以选择继续爬一个阶梯或者爬两个阶梯。 您需要找到达到楼层…
[LeetCode] Merge Two Binary Trees 合并二叉树
Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the …
【Leetcode】15. 3Sum 集合中选三个元素之和等于0
1. 题目 Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique…
[LeetCode] Triangle 三角形
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numb…
[LeetCode] 4 Keys Keyboard 四键的键盘
Imagine you have a special keyboard with the following keys: Key 1: (A): Print one ‘A’ on s…
[Leetcode] Longest Consecutive Sequence 最长连续数列
Longest Consecutive Sequence Given an unsorted array of integers, find the length of the longest consecutive e…
[LeetCode] Fizz Buzz 嘶嘶嗡嗡
Write a program that outputs the string representation of numbers from 1 to n. But for multiples o…
LeetCode 027 Remove Element
题目描述 Given an array and a value, remove all instances of that value in place and return the new length. The or…
[LeetCode] Random Pick Index 随机拾取序列
Given an array of integers with possible duplicates, randomly output the index of a given target number…