代码改变世界

[LeetCode] 684. Redundant Connection _ Medium tag: Union Find

2021-07-30 14:40 by Johnson_强生仔仔, 21 阅读, 0 推荐, 收藏, 编辑
摘要:I n this problem, a tree is an undirected graph that is connected and has no cycles. You are given a graph that started as a tree with n nodes labeled 阅读全文

[LeetCode]348. Design Tic-Tac-Toe_Medium tag: array

2021-07-30 00:41 by Johnson_强生仔仔, 31 阅读, 0 推荐, 收藏, 编辑
摘要:Assume the following rules are for the tic-tac-toe game on an n x n board between two players: A move is guaranteed to be valid and is placed on an em 阅读全文

[LeetCode] 895. Maximum Frequency Stack_Hard tag: stack

2021-07-29 23:17 by Johnson_强生仔仔, 18 阅读, 0 推荐, 收藏, 编辑
摘要:Design a stack-like data structure to push elements to the stack and pop the most frequent element from the stack. Implement the FreqStack class: Freq 阅读全文

[LeetCode] 428. Serialize and Deserialize N-ary Tree_hard tag: DFS, Divide and Conquer

2021-07-29 22:39 by Johnson_强生仔仔, 46 阅读, 0 推荐, 收藏, 编辑
摘要:Serialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer, or 阅读全文

[LeetCode] 297. Serialize and Deserialize Binary Tree_hard tag: DFS, Divide and Conquer

2021-07-29 22:03 by Johnson_强生仔仔, 9 阅读, 0 推荐, 收藏, 编辑
摘要:Serialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer, or 阅读全文

[LeetCode] 957. Prison Cells After N Days_Medium Tag: Array

2021-07-29 10:54 by Johnson_强生仔仔, 29 阅读, 0 推荐, 收藏, 编辑
摘要:There are 8 prison cells in a row and each cell is either occupied or vacant. Each day, whether the cell is occupied or vacant changes according to th 阅读全文

[LeetCode] 763. Partition Labels_Medium Tag: sort

2021-07-29 08:50 by Johnson_强生仔仔, 21 阅读, 0 推荐, 收藏, 编辑
摘要:763. Partition Labels Medium 5066206Add to ListShare You are given a string s. We want to partition the string into as many parts as possible so that 阅读全文

[LeetCode] 253. Meeting Rooms II_Medium tag: Heap

2021-07-29 08:14 by Johnson_强生仔仔, 43 阅读, 0 推荐, 收藏, 编辑
摘要:Given an array of meeting time intervals intervals where intervals[i] = [starti, endi], return the minimum number of conference rooms required. Exampl 阅读全文

[LeetCode] 252. Meeting Rooms_Easy tag: Sort

2021-07-29 07:24 by Johnson_强生仔仔, 11 阅读, 0 推荐, 收藏, 编辑
摘要:Given an array of meeting time intervals where intervals[i] = [starti, endi], determine if a person could attend all meetings. Example 1: Input: inter 阅读全文

[LeetCode] 973. K Closest Points to Origin_Medium tag: Sort, heap, quickSort

2021-07-29 07:10 by Johnson_强生仔仔, 30 阅读, 0 推荐, 收藏, 编辑
摘要:Given an array of points where points[i] = [xi, yi] represents a point on the X-Y plane and an integer k, return the k closest points to the origin (0 阅读全文
上一页 1 2 3 4 5 6 7 8 9 ··· 39 下一页