Difficulty: Medium Related Topics: Backtracking Link: https://leetcode.com/problems/permutations/ Description Given a collection of distinct integers, ...
分类:
其他好文 时间:
2020-10-27 10:57:46
阅读次数:
22
Difficulty: Medium Related Topics: Greedy Link: https://leetcode.com/problems/queue-reconstruction-by-height/ Description Suppose you have a random li ...
分类:
其他好文 时间:
2020-10-27 10:54:44
阅读次数:
28
二叉树的后续遍历(Leetcode 145) 数据结构定义: // Definition for a binary tree node. public class TreeNode { int val; TreeNode left; TreeNode right; TreeNode() {} Tre ...
分类:
其他好文 时间:
2020-10-24 10:25:33
阅读次数:
22
剑指 Offer 13. 机器人的运动范围 地上有一个m行n列的方格,从坐标 [0,0] 到坐标 [m-1,n-1] 。一个机器人从坐标 [0, 0] 的格子开始移动,它每次可以向左、右、上、下移动一格(不能移动到方格外),也不能进入行坐标和列坐标的数位之和大于k的格子。例如,当k为18时,机器人能 ...
分类:
其他好文 时间:
2020-10-22 22:53:45
阅读次数:
26
1.Socket和TCP/IP的关系 "All problems in computer science can be solved by another level of indirection." 为满足应用层需求,系统对TCP/IP层进行细节屏蔽和抽象,Socket层就相当于TCP/IP和应用 ...
分类:
系统相关 时间:
2020-10-21 21:04:10
阅读次数:
40
http://codeforces.com/problemset/problem/600/E 题意:给一个树,每个点有一个颜色,让你对于每个点,求以他为根的子树中,颜色是 出现数量最多的颜色 的节点,的编号和(如果有多个出现数量最多的颜色,都算),\(n\le 10^5\) 线段树合并 用到线段树合 ...
分类:
其他好文 时间:
2020-10-19 22:36:15
阅读次数:
20
今天主要刷leetcode的滑动窗口的题目,需要完成如下题目,本文主要记录解题思路和方法,以便加深理解记忆,答案到处都是,只有消化了才是自己的。 引子 首先来看leetcode中No. 3的无重复字符的最长子串这个题目,参考题目链接,题目很简单 给定一个字符串,请你找出其中不含有重复字符的 最长子串 ...
分类:
其他好文 时间:
2020-10-18 16:48:02
阅读次数:
30
**题目链接:**https://leetcode-cn.com/problems/squares-of-a-sorted-array/ 分析: 双指针。 Python class Solution: def sortedSquares(self, A: List[int]) -> List[int ...
分类:
编程语言 时间:
2020-10-18 09:27:17
阅读次数:
21
package LeetCode_509 /** * 509. Fibonacci Number * https://leetcode.com/problems/fibonacci-number/ * * The Fibonacci numbers, commonly denoted F(n) fo ...
分类:
其他好文 时间:
2020-10-14 20:12:53
阅读次数:
13
Difficulty: Easy Related Topics: Linked List Link: https://leetcode.com/problems/merge-two-sorted-lists/ Description Merge two sorted linked lists and ...
分类:
其他好文 时间:
2020-10-12 20:06:05
阅读次数:
22