Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/yankewei/leetcode

LeetCode 问题的解决方法
https://github.com/yankewei/leetcode

algorithm go leetcode leetcode-solutions php

Last synced: 2 days ago
JSON representation

LeetCode 问题的解决方法

Awesome Lists containing this project

README

        

# LeetCode

LeetCode问题的解决方法
### Algorithm

#### 困难程度
[![简单](https://img.shields.io/badge/%E7%AE%80%E5%8D%95-5cb85c)](https://github.com/yankewei/LeetCode-Go/labels/%E7%AE%80%E5%8D%95)
[![中等](https://img.shields.io/badge/%E4%B8%AD%E7%AD%89-f0ad4e)](https://github.com/yankewei/LeetCode-Go/labels/%E4%B8%AD%E7%AD%89)
[![困难](https://img.shields.io/badge/%E5%9B%B0%E9%9A%BE-d9534f)](https://github.com/yankewei/LeetCode-Go/labels/%E5%9B%B0%E9%9A%BE)
#### 类型
[![字符串](https://img.shields.io/badge/%E5%AD%97%E7%AC%A6%E4%B8%B2-c2e0c6)](https://github.com/yankewei/LeetCode-Go/labels/%E5%AD%97%E7%AC%A6%E4%B8%B2)
[![数组](https://img.shields.io/badge/%E6%95%B0%E7%BB%84-efa5ac)](https://github.com/yankewei/LeetCode-Go/labels/%E6%95%B0%E7%BB%84)
[![链表](https://img.shields.io/badge/%E9%93%BE%E8%A1%A8-e2f497)](https://github.com/yankewei/LeetCode-Go/labels/%E9%93%BE%E8%A1%A8)
[![设计](https://img.shields.io/badge/%E8%AE%BE%E8%AE%A1-4e32bc)](https://github.com/yankewei/LeetCode-Go/labels/%E8%AE%BE%E8%AE%A1)
[![数学](https://img.shields.io/badge/%E6%95%B0%E5%AD%A6-d4c5f9)](https://github.com/yankewei/LeetCode-Go/labels/%E6%95%B0%E5%AD%A6)
[![树](https://img.shields.io/badge/%E6%A0%91-c2e0c6)](https://github.com/yankewei/LeetCode-Go/labels/%E6%A0%91)
#### 解法
[![位运算](https://img.shields.io/badge/%E4%BD%8D%E8%BF%90%E7%AE%97-7786d1)](https://github.com/yankewei/LeetCode-Go/labels/%E4%BD%8D%E8%BF%90%E7%AE%97)
[![双指针](https://img.shields.io/badge/%E5%8F%8C%E6%8C%87%E9%92%88-388099)](https://github.com/yankewei/LeetCode-Go/labels/%E5%8F%8C%E6%8C%87%E9%92%88)
[![栈](https://img.shields.io/badge/%E6%A0%88-d015ed)](https://github.com/yankewei/LeetCode-Go/labels/%E6%A0%88)
[![滑动窗口](https://img.shields.io/badge/%E6%BB%91%E5%8A%A8%E7%AA%97%E5%8F%A3-f4d577)](https://github.com/yankewei/LeetCode-Go/labels/%E6%BB%91%E5%8A%A8%E7%AA%97%E5%8F%A3)
[![广度优先搜索](https://img.shields.io/badge/%E5%B9%BF%E5%BA%A6%E4%BC%98%E5%85%88%E6%90%9C%E7%B4%A0-61e8a4)](https://github.com/yankewei/LeetCode-Go/labels/%E5%B9%BF%E5%BA%A6%E4%BC%98%E5%85%88%E6%90%9C%E7%B4%A2)
[![动态规划](https://img.shields.io/badge/%E5%8A%A8%E6%80%81%E8%A7%84%E5%88%92-e2770b)](https://github.com/yankewei/LeetCode-Go/labels/%E5%8A%A8%E6%80%81%E8%A7%84%E5%88%92)
[![二分查找](https://img.shields.io/badge/%E4%BA%8C%E5%88%86%E6%9F%A5%E6%89%BE-3b8fba)](https://github.com/yankewei/LeetCode-Go/labels/%E4%BA%8C%E5%88%86%E6%9F%A5%E6%89%BE)
[![深度优先搜索](https://img.shields.io/badge/%E6%B7%B1%E5%BA%A6%E4%BC%98%E5%85%88%E6%90%9C%E7%B4%A2-9f59e0)](https://github.com/yankewei/LeetCode-Go/labels/%E6%B7%B1%E5%BA%A6%E4%BC%98%E5%85%88%E6%90%9C%E7%B4%A2)
[![哈希表](https://img.shields.io/badge/%E5%93%88%E5%B8%8C%E8%A1%A8-46a9bf)](https://github.com/yankewei/LeetCode-Go/labels/%E5%93%88%E5%B8%8C%E8%A1%A8)
[![排序](https://img.shields.io/badge/%E6%8E%92%E5%BA%8F-3ce522)](https://github.com/yankewei/LeetCode-Go/labels/%E6%8E%92%E5%BA%8F)
[![贪心算法](https://img.shields.io/badge/%E8%B4%AA%E5%BF%83%E7%AE%97%E6%B3%95-ed7bce)](https://github.com/yankewei/LeetCode-Go/labels/%E8%B4%AA%E5%BF%83%E7%AE%97%E6%B3%95)
[![回溯算法](https://img.shields.io/badge/%E5%9B%9E%E6%BA%AF%E7%AE%97%E6%B3%95-e5408d)](https://github.com/yankewei/LeetCode-Go/labels/%E5%9B%9E%E6%BA%AF%E7%AE%97%E6%B3%95)
[![并查集](https://img.shields.io/badge/%E5%B9%B6%E6%9F%A5%E9%9B%86-AA3CBC)](https://github.com/yankewei/LeetCode-Go/labels/%E5%B9%B6%E6%9F%A5%E9%9B%86)
[![前缀和](https://img.shields.io/badge/%E5%89%8D%E7%BC%80%E5%92%8C-584500)](https://github.com/yankewei/LeetCode-Go/labels/%E5%89%8D%E7%BC%80%E5%92%8C)
[![字典树](https://img.shields.io/badge/%E5%AD%97%E5%85%B8%E6%A0%91-D63A7F)](https://github.com/yankewei/LeetCode-Go/labels/%E5%AD%97%E5%85%B8%E6%A0%91)
[![递归](https://img.shields.io/badge/%E9%80%92%E5%BD%92-4B4B8C)](https://github.com/yankewei/LeetCode-Go/labels/%E9%80%92%E5%BD%92)
#### 题目
- [两数之和]()
- [两数相加](https://github.com/yankewei/LeetCode-Go/issues/71)
- [无重复字符的最长子串](https://github.com/yankewei/LeetCode-Go/issues/6)
- [电话号码的字母组合](https://github.com/yankewei/LeetCode-Go/issues/59)
- [有效的括号](https://github.com/yankewei/LeetCode-Go/issues/4)
- [串联所有单词的子串](https://github.com/yankewei/LeetCode-Go/issues/30)
- [在排序数组中查找元素的第一个和最后一个位置](https://github.com/yankewei/LeetCode-Go/issues/37)
- [搜索插入位置](https://github.com/yankewei/LeetCode-Go/issues/45)
- [缺失的第一个正数](https://github.com/yankewei/LeetCode-Go/issues/32)
- [字母异位词分组](https://github.com/yankewei/LeetCode-Go/issues/80)
- [最大子序和](./Algorithm/最大子序和.md)
- [最小路径和](https://github.com/yankewei/LeetCode-Go/issues/46)
- [爬楼梯](https://github.com/yankewei/LeetCode-Go/issues/16)
- [简化路径](https://github.com/yankewei/LeetCode-Go/issues/7)
- [分隔链表](https://github.com/yankewei/LeetCode-Go/issues/3) |
- [合并两个有序数组](https://github.com/yankewei/LeetCode-Go/issues/9)
- [不同的二叉搜索树](https://github.com/yankewei/LeetCode-Go/issues/44)
- [二叉树的层序遍历](https://github.com/yankewei/LeetCode-Go/issues/53)
- [二叉树的锯齿形层序遍历](https://github.com/yankewei/LeetCode-Go/issues/87)
- [二叉树的最大深度](https://github.com/yankewei/LeetCode-Go/issues/50)
- [二叉树的最小深度](https://github.com/yankewei/LeetCode-Go/issues/52)
- [路径总和](https://github.com/yankewei/LeetCode-Go/issues/41)
- [填充每个节点的下一个右侧节点指针](https://github.com/yankewei/LeetCode-Go/issues/63)
- [路径总和](https://github.com/yankewei/LeetCode-Go/issues/41)
- [杨辉三角](./Algorithm/杨辉三角.md)
- [买卖股票的最佳时机](https://github.com/yankewei/LeetCode-Go/issues/15)
- [买卖股票的最佳时机Ⅱ](./Algorithm/买卖股票的最佳时机Ⅱ.md)
- [单词接龙](https://github.com/yankewei/LeetCode-Go/issues/36)
- [复制带随机指针的链表](https://github.com/yankewei/LeetCode-Go/issues/73)
- [相交链表](https://github.com/yankewei/LeetCode-Go/issues/77)
- [两数之和 II - 输入有序数组](https://github.com/yankewei/LeetCode-Go/issues/43)
- [多数元素](https://github.com/yankewei/LeetCode-Go/issues/19)
- [打家劫舍](https://github.com/yankewei/LeetCode-Go/issues/33)
- [快乐数](https://github.com/yankewei/LeetCode-Go/issues/79)
- [长度最小的子数组](https://github.com/yankewei/LeetCode-Go/issues/38)
- [存在重复元素](./Algorithm/存在重复元素.md)
- [存在重复元素Ⅱ](./Algorithm/存在重复元素Ⅱ.md)
- [用队列实现栈](https://github.com/yankewei/LeetCode-Go/issues/5)
- [翻转二叉树](./Algorithm/Invert-Binary-Tree.md)
- [回文链表](https://github.com/yankewei/LeetCode-Go/issues/68)
- [搜索二维矩阵Ⅱ](https://github.com/yankewei/LeetCode-Go/issues/27)
- [单词规律](https://github.com/yankewei/LeetCode-Go/issues/82)
- [最长上升子序列](https://github.com/yankewei/LeetCode-Go/issues/20)
- [零钱兑换](https://github.com/yankewei/LeetCode-Go/issues/14)
- [整数拆分](https://github.com/yankewei/LeetCode-Go/issues/51)
- [反转字符串中的元音字母](https://github.com/yankewei/LeetCode-Go/issues/60)
- [两个数组的交集 II](https://github.com/yankewei/LeetCode-Go/issues/42)
- [水壶问题](https://github.com/yankewei/LeetCode-Go/issues/28)
- [字符串中的第一个唯一字符](https://github.com/yankewei/LeetCode-Go/issues/88)
- [找不同](https://github.com/yankewei/LeetCode-Go/issues/84)
- [判断子序列](https://github.com/yankewei/LeetCode-Go/issues/49)
- [最长回文串](https://github.com/yankewei/LeetCode-Go/issues/26)
- [分割数组的最大值](https://github.com/yankewei/LeetCode-Go/issues/48)
- [两数相加 II](https://github.com/yankewei/LeetCode-Go/issues/76)
- [扁平化多级双向链表](https://github.com/yankewei/LeetCode-Go/issues/72)
- [分发饼干](https://github.com/yankewei/LeetCode-Go/issues/89)
- [重复的子字符串](https://github.com/yankewei/LeetCode-Go/issues/40)
- [岛屿的周长](https://github.com/yankewei/LeetCode-Go/issues/21)
- [下一个更大元素 I](https://github.com/yankewei/LeetCode-Go/issues/8)
- [二叉搜索树的最小绝对差](https://github.com/yankewei/LeetCode-Go/issues/61)
- [反转字符串中的单词 III](https://github.com/yankewei/LeetCode-Go/issues/55)
- [合并二叉树](https://github.com/yankewei/LeetCode-Go/issues/70)
- [岛屿的最大面积](https://github.com/yankewei/LeetCode-Go/issues/22)
- [买卖股票的最佳时机含手续费](https://github.com/yankewei/LeetCode-Go/issues/83)
- [单调递增的数字](https://github.com/yankewei/LeetCode-Go/issues/81)
- [矩形重叠](https://github.com/yankewei/LeetCode-Go/issues/25)
- [链表的中间结点](https://github.com/yankewei/LeetCode-Go/issues/29)
- [比较含退格的字符串](https://github.com/yankewei/LeetCode-Go/issues/66)
- [两句话中的不常见单词](https://github.com/yankewei/LeetCode-Go/issues/78)
- [长按键入](https://github.com/yankewei/LeetCode-Go/issues/67)
- [有效的山脉数组](https://github.com/yankewei/LeetCode-Go/issues/69)
- [使数组唯一的最小增量](https://github.com/yankewei/LeetCode-Go/issues/31)
- [有序数组的平方](https://github.com/yankewei/LeetCode-Go/issues/64)
- [数组形式的整数加法](https://github.com/yankewei/LeetCode-Go/issues/95)
- [腐烂的橘子](https://github.com/yankewei/LeetCode-Go/issues/10)
- [查找常用字符](https://github.com/yankewei/LeetCode-Go/issues/62)
- [总持续时间可被 60 整除的歌曲](https://github.com/yankewei/LeetCode-Go/issues/34)
- [将数组分成和相等的三个部分](https://github.com/yankewei/LeetCode-Go/issues/17)
- [最后一块石头的重量](https://github.com/yankewei/LeetCode-Go/issues/90)
- [字符串的最大公因子](https://github.com/yankewei/LeetCode-Go/issues/18)
- [分糖果 II](https://github.com/yankewei/LeetCode-Go/issues/11)
- [拼写单词](https://github.com/yankewei/LeetCode-Go/issues/24)
- [二进制链表转整数](https://github.com/yankewei/LeetCode-Go/issues/1)
- [拥有最多糖果的孩子](https://github.com/yankewei/LeetCode-Go/issues/35)
- [一维数组的动态和](https://github.com/yankewei/LeetCode-Go/issues/47)
- [千位分隔数](https://github.com/yankewei/LeetCode-Go/issues/97)
- [你可以获得的最大硬币数目](https://github.com/yankewei/LeetCode-Go/issues/56)
- [返回倒数第 k 个节点](https://github.com/yankewei/LeetCode-Go/issues/2)
- [最长连续递增序列](https://github.com/yankewei/LeetCode-Go/issues/98)
- [省份数量](https://github.com/yankewei/LeetCode-Go/issues/99)
- [等价多米诺骨牌对的数量](https://github.com/yankewei/LeetCode-Go/issues/100)
- [寻找数组的中心索引](https://github.com/yankewei/LeetCode-Go/issues/101)
- [和为K的子数组](https://github.com/yankewei/LeetCode-Go/issues/102)
- [公平的糖果棒交换](https://github.com/yankewei/LeetCode-Go/issues/105)
- [替换后的最长重复字符](https://github.com/yankewei/LeetCode-Go/issues/106)
- [子数组最大平均数 I](https://github.com/yankewei/LeetCode-Go/issues/107)
- [尽可能使字符串相等](https://github.com/yankewei/LeetCode-Go/issues/108)
- [最大连续1的个数](https://github.com/yankewei/LeetCode-Go/issues/109)
- [数组拆分 I](https://github.com/yankewei/LeetCode-Go/issues/110)
- [重塑矩阵](https://github.com/yankewei/LeetCode-Go/issues/111)
- [最大连续1的个数 III](https://github.com/yankewei/LeetCode-Go/issues/112)
- [翻转图像](https://github.com/yankewei/LeetCode-Go/issues/116)
- [转置矩阵](https://github.com/yankewei/LeetCode-Go/issues/117)
- [括号生成](https://github.com/yankewei/LeetCode-Go/issues/118)
- [单调数列](https://github.com/yankewei/LeetCode-Go/issues/119)
- [区域和检索 - 数组不可变](https://github.com/yankewei/LeetCode-Go/issues/120)
- [比特位计数](https://github.com/yankewei/LeetCode-Go/issues/121)
- [俄罗斯套娃信封问题](https://github.com/yankewei/LeetCode-Go/issues/122)
- [删除字符串中的所有相邻重复项](https://github.com/yankewei/LeetCode-Go/issues/123)
- [基本计算器 II](https://github.com/yankewei/LeetCode-Go/issues/124)
- [子集](https://github.com/yankewei/LeetCode-Go/issues/129)
- [笨阶乘](https://github.com/yankewei/LeetCode-Go/issues/130)
- [最大数](https://github.com/yankewei/LeetCode-Go/issues/131)
- [二叉搜索树节点最小距离](https://github.com/yankewei/LeetCode-Go/issues/132)
- [实现 Trie (前缀树)](https://github.com/yankewei/LeetCode-Go/issues/133)
- [打家劫舍 II](https://github.com/yankewei/LeetCode-Go/issues/134)
- [递增顺序搜索树](https://github.com/yankewei/LeetCode-Go/issues/135)
- [错误的集合](https://github.com/yankewei/LeetCode-Go/issues/136)
- [点菜展示表](https://github.com/yankewei/LeetCode-Go/issues/137)
- [基于时间的键值存储](https://github.com/yankewei/LeetCode-Go/issues/138)
- [逐步求和得到正数的最小值](https://github.com/yankewei/LeetCode-Go/issues/140)
- [找出数组的最大公约数](https://github.com/yankewei/LeetCode-Go/issues/141)
- [寻找峰值](https://github.com/yankewei/LeetCode-Go/issues/142)
- [截断句子](https://github.com/yankewei/LeetCode-Go/issues/143)
- [差的绝对值为 K 的数对数目](https://github.com/yankewei/LeetCode-Go/issues/144)
- [单值二叉树](https://github.com/yankewei/LeetCode-Go/issues/145)
- [生成每种字符都是奇数个的字符串](https://github.com/yankewei/LeetCode/issues/147)
- [有序队列](https://github.com/yankewei/LeetCode/issues/148)
- [非递增顺序的最小子序列](https://github.com/yankewei/LeetCode/issues/149)
- [数组中的字符串匹配](https://github.com/yankewei/LeetCode/issues/150)
- [在二叉树中增加一行](https://github.com/yankewei/LeetCode/issues/151)
- [函数的独占时间](https://github.com/yankewei/LeetCode/issues/152)
- [层数最深叶子节点的和](https://github.com/yankewei/LeetCode/issues/153)
- [检查单词是否为句中其他单词的前缀](https://github.com/yankewei/LeetCode/issues/154)
- [重新排列单词间的空格](https://github.com/yankewei/LeetCode/issues/157)
- [文件夹操作日志搜集器](https://github.com/yankewei/LeetCode/issues/158)
- [按照频率将数组升序排序](https://github.com/yankewei/LeetCode/issues/159)
- [最长的字母序连续子字符串的长度](https://github.com/yankewei/LeetCode/issues/161)
- [移动片段得到字符串](https://github.com/yankewei/LeetCode/issues/162)
- [到最近的人的最大距离](https://github.com/yankewei/LeetCode/issues/163)
- [统计参与通信的服务器](https://github.com/yankewei/LeetCode/issues/164)
- [统计二叉树中好节点的数目](https://github.com/yankewei/LeetCode/issues/165)
- [汇总区间](https://github.com/yankewei/LeetCode/issues/166)
#### 周赛题
- [重复至少 K 次且长度为 M 的模式 (204周赛题)](https://github.com/yankewei/LeetCode-Go/issues/54)
- [替换所有的问号(205周赛题)](https://github.com/yankewei/LeetCode-Go/issues/57)
- [交换链表中的节点](https://github.com/yankewei/LeetCode-Go/issues/92)
- [同积元组【第224场周赛】](https://github.com/yankewei/LeetCode-Go/issues/94)
- [避免重复字母的最小删除成本(205周赛题)](https://github.com/yankewei/LeetCode-Go/issues/58)
- [两个相同字符之间的最长子字符串](https://github.com/yankewei/LeetCode-Go/issues/65)
- [检查两个字符串数组是否相等【216场周赛题】](https://github.com/yankewei/LeetCode-Go/issues/74)
- [具有给定数值的最小字符串【216场周赛题】](https://github.com/yankewei/LeetCode-Go/issues/75)
- [重新格式化电话号码 【第220场周赛】](https://github.com/yankewei/LeetCode-Go/issues/85)
- [删除子数组的最大得分 【第220场周赛】](https://github.com/yankewei/LeetCode-Go/issues/86)
- [可以形成最大正方形的矩形数目【224场周赛】](https://github.com/yankewei/LeetCode-Go/issues/93)
- [替换隐藏数字得到的最晚时间【第225场周赛】](https://github.com/yankewei/LeetCode-Go/issues/96)
- [盒子中小球的最大数量](https://github.com/yankewei/LeetCode-Go/issues/103)
- [从相邻元素对还原数组](https://github.com/yankewei/LeetCode-Go/issues/104)
- [交替合并字符串](https://github.com/yankewei/LeetCode-Go/issues/114)
- [移动所有球到每个盒子所需的最小操作数](https://github.com/yankewei/LeetCode-Go/issues/115)
- [字符串中第二大的数字](https://github.com/yankewei/LeetCode-Go/issues/125)
- [字符串中不同整数的数目](https://github.com/yankewei/LeetCode-Go/issues/126)
- [还原排列的最少操作步数](https://github.com/yankewei/LeetCode-Go/issues/127)
- [替换字符串中的括号内容](https://github.com/yankewei/LeetCode-Go/issues/128)
- [检查字符串是否为数组前缀](https://github.com/yankewei/LeetCode-Go/issues/139)
- [使数组中所有元素都等于零](https://github.com/yankewei/LeetCode/issues/146)
- [和有限的最长子序列](https://github.com/yankewei/LeetCode/issues/155)
- [从字符串中移除星号](https://github.com/yankewei/LeetCode/issues/156)
#### 面试题
- [和为s的连续正数序列](https://github.com/yankewei/LeetCode-Go/issues/12)
- [队列的最大值](https://github.com/yankewei/LeetCode-Go/issues/13)
- [字符串压缩](https://github.com/yankewei/LeetCode-Go/issues/23)
- [用两个栈实现队列](https://github.com/yankewei/LeetCode-Go/issues/39)