Given a collection of intervals, merge all overlapping intervals. For example, Given [1,3],[2,6],[8,10]…
分类:LeetCode
LeetCode 020 Valid Parentheses
题目描述 Given a string containing just the characters ‘(‘, ‘)’, ‘{‘, ‘}’, ‘[‘ and ‘]’, determine if the input str…
959. Regions Cut By Slashes
In a N x N grid composed of 1 x 1 squares, each 1 x 1 square consists of a /, , or blank space. These characte…
513. Find Bottom Left Tree Value
Given a binary tree, find the leftmost value in the last row of the tree. Example 1: Input: 2 / \ 1 3 Output: …
[Leetcode] Longest Substring with At Most 2 Distinct Characters
Longest Substring with At Most Two Distinct Characters 最新思路解法:https://yanjia.me/zh/2018/12/… Given a str…
力扣(LeetCode)934
题目地址:https://leetcode-cn.com/probl…题目描述:在给定的二维二进制数组 A 中,存在两座岛。(岛是由四面相连的 1 形成的一个最大组。) 现在,我们可以将 0 变为 1,以使两…
040 Combination Sum II[M]
1 题目描述 Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C …
2016.9.12; Leetcode 292. Nim Game
You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one…
LeetCode 190.颠倒二进制位
题目描述 颠倒给定的 32 位无符号整数的二进制位。 示例: 输入: 43261596 输出: 964176192 解释: 43261596 的二进制表示形式为 00000010100101000001111010011…
Swift LeetCode 系列之48:rotate-image
https://leetcode.com/problems/rotate-image/description/ 沿着副对角反转一次. 在沿着水平线翻转一次即可 class Solution { func rotate(_…
二刷31. Next Permutation
Medium 面经题 很直观的思路。找next permutation先找哪里可以下手,也就是从后到前数第一个nums[j-1] < nums[j]的地方,比如1243 找到2那里,next permutation…
二刷146. LRU Cache
Hard FB tag HashMap + LinkedList. 思路还挺特别的,记录的是prevNodes的map, 可以留意一下如何写moveToTail这个helper method的写法 class LRUCa…