随笔分类 - LeetCode
摘要:LeetCode 面试题59 II. 队列的最大值【Medium】【Python】【队列】 问题 "力扣" 请定义一个队列并实现函数 得到队列里的最大值,要求函数 、`push_back pop_front` 的 均摊 时间复杂度都是O(1)。 若队列为空, 和 需要返回 1 示例 1: 示例 2:
阅读全文
摘要:LeetCode 0039. Combination Sum组合总和【Medium】【Python】【回溯】 Problem "LeetCode" Given a set of candidate numbers ( ) (without duplicates) and a target numbe
阅读全文
摘要:LeetCode 面试题 57 Ⅱ. 和为s的连续正数序列【Easy】【Python】【滑窗】【数学】 问题 "力扣" 输入一个正整数 target ,输出所有和为 target 的连续正整数序列(至少含有两个数)。 序列内的数字由小到大排列,不同序列按照首个数字从小到大排列。 示例 1: 示例 2
阅读全文
摘要:LeetCode 0077. Combinations组合【Medium】【Python】【回溯】 Problem "LeetCode" Given two integers n and k , return all possible combinations of k numbers out of
阅读全文
摘要:LeetCode 0047. Permutations II全排列 II【Medium】【Python】【回溯】 Problem "LeetCode" Given a collection of numbers that might contain duplicates, return all po
阅读全文
摘要:LeetCode 1103. Distribute Candies to People分糖果 II【Easy】【Python】【暴力】 Problem "LeetCode" We distribute some number of , to a row of people in the follow
阅读全文
摘要:LeetCode 0046. Permutations全排列【Medium】【Python】【回溯】【DFS】 Problem "LeetCode" Given a collection of distinct integers, return all possible permutations.
阅读全文
摘要:LeetCode 0079. Word Search单词搜索【Medium】【Python】【DFS】 Problem "LeetCode" Given a 2D board and a word, find if the word exists in the grid. The word can
阅读全文
摘要:LeetCode 0017. Letter Combinations of a Phone Number电话号码的字母组合【Medium】【Python】【回溯】【DFS】【暴力】 Problem "LeetCode" Given a string containing digits from in
阅读全文
摘要:LeetCode 0093. Restore IP Addresses复原IP地址【Medium】【Python】【回溯】【DFS】【暴力】 Problem "LeetCode" Given a string containing only digits, restore it by returni
阅读全文
摘要:LeetCode 0994. Rotting Oranges腐烂的橘子【Easy】【Python】【BFS】 Problem "LeetCode" In a given grid, each cell can have one of three values: the value represent
阅读全文
摘要:LeetCode 面试题 10.01. Sorted Merge LCCI【Easy】【Python】【双指针】 问题 "力扣" 给定两个排序后的数组 A 和 B,其中 A 的末端有足够的缓冲空间容纳 B。 编写一个方法,将 B 合并入 A 并排序。 初始化 A 和 B 的元素数量分别为 m 和 n
阅读全文
摘要:LeetCode 0257. Binary Tree Paths二叉树的所有路径【Easy】【Python】【DFS】 Problem "LeetCode" Given a binary tree, return all root to leaf paths. Note: A leaf is a n
阅读全文
摘要:LeetCode 0206. Reverse Linked List反转链表【Easy】【Python】【链表】 Problem "LeetCode" Reverse a singly linked list. Example: Follow up: A linked list can be rev
阅读全文
摘要:LeetCode 0225. Implement Stack using Queues用队列实现栈【Easy】【Python】【栈】【队列】 Problem "LeetCode" Implement the following operations of a stack using queues.
阅读全文
摘要:LeetCode 1366. Rank Teams by Votes通过投票对团队排名【Medium】【Python】【排序】 Problem "LeetCode" In a special ranking system, each voter gives a rank from highest t
阅读全文
摘要:LeetCode 1365. How Many Numbers Are Smaller Than the Current Number有多少小于当前数字的数字【Easy】【Python】【暴力】 Problem "LeetCode" Given the array , for each find o
阅读全文
摘要:LeetCode 面试题 04.10. 检查子树【Medium】【Python】【DFS】 问题 "力扣" 检查子树。你有两棵非常大的二叉树:T1,有几万个节点;T2,有几万个节点。设计一个算法,判断 T2 是否为 T1 的子树。 如果 T1 有这么一个节点 n,其子树与 T2 一模一样,则 T2
阅读全文
摘要:LeetCode 1367. Linked List in Binary Tree二叉树中的列表【Medium】【Python】【DFS】 Problem "LeetCode" Given a binary tree and a linked list with as the first node.
阅读全文
摘要:LeetCode 0417. Pacific Atlantic Water Flow太平洋大西洋水流问题【Medium】【Python】【DFS】 Problem "LeetCode" Given an matrix of non negative integers representing the
阅读全文

浙公网安备 33010602011771号