https://leetcode.com/problems/all-ancestors-of-a-node-in-a-directed-acyclic-graph/description/
List of ancestors in a DAG #medium #dfs #toposort
List of ancestors in a DAG #medium #dfs #toposort
👍3
June 29, 2024
https://leetcode.com/problems/remove-max-number-of-edges-to-keep-graph-fully-traversable/description/
Remove extra nodes in a connected graph by type 1, 2 and 3=1+2 #hard #union-find
Remove extra nodes in a connected graph by type 1, 2 and 3=1+2 #hard #union-find
👍3
June 30, 2024
https://leetcode.com/problems/intersection-of-two-arrays-ii/description/
Array intersection with duplicates #easy
Array intersection with duplicates #easy
👍2
July 2, 2024
https://leetcode.com/problems/minimum-difference-between-largest-and-smallest-value-in-three-moves/description/
Min difference after 3 changes in array #medium #sliding_window #dynamic_programming
Min difference after 3 changes in array #medium #sliding_window #dynamic_programming
👍2
July 3, 2024
https://leetcode.com/problems/merge-nodes-in-between-zeros/description/
Collapse in-between
Collapse in-between
0
nodes in a LinkedList #medium #linked_list👍2
July 4, 2024
https://leetcode.com/problems/find-the-minimum-and-maximum-number-of-nodes-between-critical-points/description/
[min, max] distance between critical points in linked list #medium #linked_list
[min, max] distance between critical points in linked list #medium #linked_list
👍3
July 5, 2024
https://leetcode.com/problems/pass-the-pillow/description/
Loop position in increasing-decreasing array #easy #math #simulation
Loop position in increasing-decreasing array #easy #math #simulation
👍3
July 6, 2024
https://leetcode.com/problems/water-bottles/description/
Bottles drink and exchange simulation #easy #math #simulation
Bottles drink and exchange simulation #easy #math #simulation
👍2
July 7, 2024
https://leetcode.com/problems/find-the-winner-of-the-circular-game/description/
Last of
Last of
k-th
excluded from 1..n
#medium #simulation #math👍3
July 8, 2024
https://leetcode.com/problems/average-waiting-time/description/
Average of intersecting intervals #medium #simulation
Average of intersecting intervals #medium #simulation
👍2
July 9, 2024
https://leetcode.com/problems/reverse-substrings-between-each-pair-of-parentheses/description/
Reverse string in parentheses recursively #medium
Reverse string in parentheses recursively #medium
👍3
July 11, 2024
https://leetcode.com/problems/maximum-score-from-removing-substrings/description/
Max score removing from
Max score removing from
s
, x
for ab
, y
for ba
#medium #greedy #stack👍2
July 12, 2024
https://leetcode.com/problems/robot-collisions/description/
1-D dimensional robots fight #hard #stack
1-D dimensional robots fight #hard #stack
👍2
July 13, 2024
https://leetcode.com/problems/number-of-atoms/description/
Simplify chemical formula parenthesis #hard #stack
Simplify chemical formula parenthesis #hard #stack
👍2
July 14, 2024
https://leetcode.com/problems/create-binary-tree-from-descriptions/description/
Restore binary tree from
Restore binary tree from
[parent, child, isLeft]
#medium👍3
July 15, 2024
https://leetcode.com/problems/step-by-step-directions-from-a-binary-tree-node-to-another/description/
U
-L
-R
path from s
to d
in a Binary Tree #medium #tree👍3
July 16, 2024
https://leetcode.com/problems/delete-nodes-and-return-forest/description/
Trees after remove nodes from tree #medium #tree
Trees after remove nodes from tree #medium #tree
👍3
July 17, 2024
https://leetcode.com/problems/number-of-good-leaf-nodes-pairs/description/
Count at most
Count at most
distance
paths between leafs #medium #tree👍2
July 18, 2024
https://leetcode.com/problems/lucky-numbers-in-a-matrix/description/
Min in rows and max in columns in a unique number matrix #easy
Min in rows and max in columns in a unique number matrix #easy
👍3
July 19, 2024