SKHuang1993 / LeetCode-Go

✅ Solutions to LeetCode by Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LeetCode by Go

[LeetCode Online Judge] (https://leetcode.com/) is a website containing many algorithm questions. Most of them are real interview questions of Google, Facebook, LinkedIn, Apple, etc. This repo shows my solutions by Go with the code style strictly follows the Google Golang Style Guide. Please feel free to reference and STAR to support this repo, thank you!

Data Structures

标识了 (已全部做完) 的专题是完成所有题目了的,没有标识的是还没有做完所有题目的

数据结构 变种 相关题目
顺序线性表:向量
单链表 1.双链表
2.静态链表
3.对称矩阵
4.稀疏矩阵
广义栈
队列 1.链表实现
2.循环数组实现
3.双端队列
字符串 1.KMP算法
2.有限状态自动机
3.模式匹配有限状态自动机
4.BM模式匹配算法
5.BM-KMP算法
1.二叉树
2.并查集
3.Huffman数
数组实现的堆 1.极大堆和极小堆
2.极大极小堆
3.双端堆
4.d叉堆
树实现的堆 1.左堆
2.扁堆
3.二项式堆
4.斐波那契堆
5.配对堆
查找 1.哈希表
2.跳跃表
3.排序二叉树
4.AVL树
5.B树
6.AA树
7.红黑树
8.排序二叉堆
9.Splay树
10.双链树
11.Trie树

算法

一.分类

Array

Title Solution Difficulty Time Space 收藏
1. Two Sum Go Easy O(n) O(n)
11. Container With Most Water Go Medium O(n) O(1)
15. 3Sum Go Medium O(n^2) O(n) ❤️
16. 3Sum Closest Go Medium O(n^2) O(1)
18. 4Sum Go Medium O(n^3) O(n^2) ❤️
26. Remove Duplicates from Sorted Array Go Easy O(n) O(1)
27. Remove Element Go Easy O(n) O(1)
39. Combination Sum Go Medium O(n log n) O(n)
40. Combination Sum II Go Medium O(n log n) O(n)
41. First Missing Positive Go Hard O(n) O(n)
42. Trapping Rain Water Go Hard O(n) O(1)
48. Rotate Image Go Medium O(n) O(1)
53. Maximum Subarray Go Easy O(n) O(n)
54. Spiral Matrix Go Medium O(n) O(n^2)
56. Merge Intervals Go Medium O(n log n) O(1)
57. Insert Interval Go Hard O(n) O(1)
59. Spiral Matrix II Go Medium O(n) O(n^2)
62. Unique Paths Go Medium O(n^2) O(n^2)
63. Unique Paths II Go Medium O(n^2) O(n^2)
64. Minimum Path Sum Go Medium O(n^2) O(n^2)
75. Sort Colors Go Medium O(n) O(1)
78. Subsets Go Medium O(n^2) O(n)
79. Word Search Go Medium O(n^2) O(n^2)
80. Remove Duplicates from Sorted Array II Go Medium O(n^2) O(n^2)
84. Largest Rectangle in Histogram Go Medium O(n) O(n)
88. Merge Sorted Array Go Easy O(n) O(1)
90. Subsets II Go Medium O(n^2) O(n)
120. Triangle Go Medium O(n^2) O(n)
121. Best Time to Buy and Sell Stock Go Easy O(n) O(1)
122. Best Time to Buy and Sell Stock II Go Easy O(n) O(1)
126. Word Ladder II Go Hard O(n) O(n^2)
152. Maximum Product Subarray Go Medium O(n) O(1)
167. Two Sum II - Input array is sorted Go Easy O(n) O(1)
209. Minimum Size Subarray Sum Go Medium O(n) O(1)
216. Combination Sum III Go Medium O(n) O(1)
217. Contains Duplicate Go Easy O(n) O(n)
219. Contains Duplicate II Go Easy O(n) O(n)
283. Move Zeroes Go Easy O(n) O(1)
287. Find the Duplicate Number Go Easy O(n) O(1)
532. K-diff Pairs in an Array Go Easy O(n) O(n)
566. Reshape the Matrix Go Easy O(n^2) O(n^2)
628. Maximum Product of Three Numbers Go Easy O(n) O(1)
713. Subarray Product Less Than K Go Medium O(n) O(1)
714. Best Time to Buy and Sell Stock with Transaction Fee Go Medium O(n) O(1)
746. Min Cost Climbing Stairs Go Easy O(n) O(1)
766. Toeplitz Matrix Go Easy O(n) O(1)
867. Transpose Matrix Go Easy O(n) O(1)
891. Sum of Subsequence Widths Go Hard O(n) O(1)
907. Sum of Subarray Minimums Go Medium O(n) O(1)
922. Sort Array By Parity II Go Medium O(n) O(1)
969. Pancake Sorting Go Medium O(n) O(1)
977. Squares of a Sorted Array Go Easy O(n) O(1)
----------------------------------------------------------------- ------------- ------------- -------------------------- -------------------------- -------------

String

Title Solution Difficulty Time Space 收藏
3. Longest Substring Without Repeating Characters Go Medium O(n) O(1)
17. Letter Combinations of a Phone Number Go Medium O(log n) O(1)
20. Valid Parentheses Go Easy O(log n) O(1)
22. Generate Parentheses Go Medium O(log n) O(1)
28. Implement strStr() Go Easy O(n) O(1)
30. Substring with Concatenation of All Words Go Hard O(n) O(n)
49. Group Anagrams Go Medium O(n log n) O(n)
71. Simplify Path Go Medium O(n) O(n)
76. Minimum Window Substring Go Hard O(n) O(n)
91. Decode Ways Go Medium O(n) O(n)
93. Restore IP Addresses Go Medium O(log n) O(n)
125. Valid Palindrome Go Easy O(n) O(1)
126. Word Ladder II Go Hard O(n) O(n^2)
344. Reverse String Go Easy O(n) O(1)
345. Reverse Vowels of a String Go Easy O(n) O(1)
767. Reorganize String Go Medium O(n log n) O(log n) ❤️
842. Split Array into Fibonacci Sequence Go Medium O(n^2) O(1)
856. Score of Parentheses Go Medium O(n) O(n)
925. Long Pressed Name Go Easy O(n) O(1)
1003. Check If Word Is Valid After Substitutions Go Medium O(n) O(1)
----------------------------------------------------------------- ------------- ------------- -------------------------- -------------------------- -------------

Linked List (已全部做完)

  • 巧妙的构造虚拟头结点。可以使遍历处理逻辑更加统一。
  • 灵活使用递归。构造递归条件,使用递归可以巧妙的解题。不过需要注意有些题目不能使用递归,因为递归深度太深会导致超时和栈溢出。
  • 链表区间逆序。第 92 题。
  • 链表寻找中间节点。第 876 题。链表寻找倒数第 n 个节点。第 19 题。只需要一次遍历就可以得到答案。
  • 合并 K 个有序链表。第 21 题,第 23 题。
  • 链表归类。第 86 题,第 328 题。
  • 链表排序,时间复杂度要求 O(n * log n),空间复杂度 O(1)。只有一种做法,归并排序,至顶向下归并。第 148 题。
  • 判断链表是否存在环,如果有环,输出环的交叉点的下标;判断 2 个链表是否有交叉点,如果有交叉点,输出交叉点。第 141 题,第 142 题,第 160 题。
Title Solution Difficulty Time Space 收藏
2. Add Two Numbers Go Medium O(n) O(1)
19. Remove Nth Node From End of List Go Medium O(n) O(1)
21. Merge Two Sorted Lists Go Easy O(log n) O(1)
23. Merge k Sorted Lists Go Hard O(log n) O(1) ❤️
24. Swap Nodes in Pairs Go Medium O(n) O(1)
25. Reverse Nodes in k-Group Go Hard O(log n) O(1) ❤️
61. Rotate List Go Medium O(n) O(1)
82. Remove Duplicates from Sorted List II Go Medium O(n) O(1)
83. Remove Duplicates from Sorted List Go Easy O(n) O(1)
86. Partition List Go Medium O(n) O(1) ❤️
92. Reverse Linked List II Go Medium O(n) O(1) ❤️
109. Convert Sorted List to Binary Search Tree Go Medium O(log n) O(n)
141. Linked List Cycle Go Easy O(n) O(1) ❤️
142. Linked List Cycle II Go Medium O(n) O(1) ❤️
143. Reorder List Go Medium O(n) O(1) ❤️
147. Insertion Sort List Go Medium O(n) O(1)
148. Sort List Go Medium O(log n) O(n) ❤️
160. Intersection of Two Linked Lists Go Easy O(n) O(1) ❤️
203. Remove Linked List Elements Go Easy O(n) O(1)
206. Reverse Linked List Go Easy O(n) O(1)
234. Palindrome Linked List Go Easy O(n) O(1)
237. Delete Node in a Linked List Go Easy O(n) O(1)
328. Odd Even Linked List Go Medium O(n) O(1)
445. Add Two Numbers II Go Medium O(n) O(n)
725. Split Linked List in Parts Go Medium O(n) O(1)
817. Linked List Components Go Medium O(n) O(1)
707. Design Linked List Go Easy O(n) O(1)
876. Middle of the Linked List Go Easy O(n) O(1) ❤️
1019. Next Greater Node In Linked List Go Medium O(n) O(1)
---------------------------------------------------------------------------- ------------- ------------- ------------- ------------- -------------

Stack (已全部做完)

Title Solution Difficulty Time Space 收藏
20. Valid Parentheses Go Easy O(log n) O(1)
42. Trapping Rain Water Go Hard O(n) O(1)
71. Simplify Path Go Medium O(n) O(n)
84. Largest Rectangle in Histogram Go Medium O(n) O(n)
94. Binary Tree Inorder Traversal Go Medium O(n) O(1)
103. Binary Tree Zigzag Level Order Traversal Go Medium O(n) O(n)
144. Binary Tree Preorder Traversal Go Medium O(n) O(1)
145. Binary Tree Postorder Traversal Go Hard O(n) O(1)
150. Evaluate Reverse Polish Notation Go Medium O(n) O(1)
155. Min Stack Go Easy O(n) O(n)
173. Binary Search Tree Iterator Go Medium O(n) O(1)
224. Basic Calculator Go Hard O(n) O(n)
225. Implement Stack using Queues Go Easy O(n) O(n)
232. Implement Queue using Stacks Go Easy O(n) O(n)
331. Verify Preorder Serialization of a Binary Tree Go Medium O(n) O(1)
394. Decode String Go Medium O(n) O(n)
402. Remove K Digits Go Medium O(n) O(1)
456. 132 Pattern Go Medium O(n) O(n)
496. Next Greater Element I Go Easy O(n) O(n)
503. Next Greater Element II Go Medium O(n) O(n)
636. Exclusive Time of Functions Go Medium O(n) O(n)
682. Baseball Game Go Easy O(n) O(n)
726. Number of Atoms Go Hard O(n) O(n)
735. Asteroid Collision Go Medium O(n) O(n)
739. Daily Temperatures Go Medium O(n) O(n)
844. Backspace String Compare Go Easy O(n) O(n)
856. Score of Parentheses Go Medium O(n) O(n)
880. Decoded String at Index Go Medium O(n) O(n)
895. Maximum Frequency Stack Go Hard O(n) O(n)
901. Online Stock Span Go Medium O(n) O(n)
907. Sum of Subarray Minimums Go Medium O(n) O(1)
921. Minimum Add to Make Parentheses Valid Go Medium O(n) O(n)
946. Validate Stack Sequences Go Medium O(n) O(n)
1003. Check If Word Is Valid After Substitutions Go Medium O(n) O(1)
1019. Next Greater Node In Linked List Go Medium O(n) O(1)
1021. Remove Outermost Parentheses Go Medium O(n) O(1)
1047. Remove All Adjacent Duplicates In String Go Medium O(n) O(1)
----------------------------------------------------------------- ------------- ------------- -------------------------- -------------------------- -------------

Tree

Title Solution Difficulty Time Space 收藏
94. Binary Tree Inorder Traversal Go Medium O(n) O(1)
96. Unique Binary Search Trees Go Medium O(n^2) O(n)
98. Validate Binary Search Tree Go Medium O(n) O(1)
99. Recover Binary Search Tree Go Hard O(n) O(1)
100. Same Tree Go Easy O(n) O(1)
101. Symmetric Tree Go Easy O(n) O(1)
102. Binary Tree Level Order Traversal Go Medium O(n) O(1)
103. Binary Tree Zigzag Level Order Traversal Go Medium O(n) O(n)
104. Maximum Depth of Binary Tree Go Easy O(n) O(1)
107. Binary Tree Level Order Traversal II Go Easy O(n) O(1)
108. Convert Sorted Array to Binary Search Tree Go Easy O(n) O(1)
110. Balanced Binary Tree Go Easy O(n) O(1)
111. Minimum Depth of Binary Tree Go Easy O(n) O(1)
112. Path Sum Go Easy O(n) O(1)
113. Path Sum II Go Medium O(n) O(1)
114. Flatten Binary Tree to Linked List Go Medium O(n) O(1)
124. Binary Tree Maximum Path Sum Go Hard O(n) O(1)
129. Sum Root to Leaf Numbers Go Medium O(n) O(1)
144. Binary Tree Preorder Traversal Go Medium O(n) O(1)
145. Binary Tree Postorder Traversal Go Hard O(n) O(1)
173. Binary Search Tree Iterator Go Medium O(n) O(1)
199. Binary Tree Right Side View Go Medium O(n) O(1)
222. Count Complete Tree Nodes Go Medium O(n) O(1)
226. Invert Binary Tree Go Easy O(n) O(1)
230. Kth Smallest Element in a BST Go Medium O(n) O(1)
235. Lowest Common Ancestor of a Binary Search Tree Go Easy O(n) O(1)
236. Lowest Common Ancestor of a Binary Tree Go Medium O(n) O(1)
257. Binary Tree Paths Go Easy O(n) O(1)
404. Sum of Left Leaves Go Easy O(n) O(1)
437. Path Sum III Go Easy O(n) O(1)
515. Find Largest Value in Each Tree Row Go Medium O(n) O(n)
637. Average of Levels in Binary Tree Go Easy O(n) O(n)
993. Cousins in Binary Tree Go Easy O(n) O(1)
----------------------------------------------------------------- ------------- ------------- -------------------------- -------------------------- -------------

Dynamic Programming

Title Solution Difficulty Time Space 收藏
53. Maximum Subarray Go Easy O(n) O(n)
62. Unique Paths Go Medium O(n^2) O(n^2)
63. Unique Paths II Go Medium O(n^2) O(n^2)
64. Minimum Path Sum Go Medium O(n^2) O(n^2)
70. Climbing Stairs Go Easy O(n) O(n)
91. Decode Ways Go Medium O(n) O(n)
96. Unique Binary Search Trees Go Medium O(n) O(n)
120. Triangle Go Medium O(n^2) O(n)
121. Best Time to Buy and Sell Stock Go Easy O(n) O(1)
152. Maximum Product Subarray Go Medium O(n) O(1)
198. House Robber Go Easy O(n) O(n)
213. House Robber II Go Medium O(n) O(n)
300. Longest Increasing Subsequence Go Medium O(n log n) O(n)
309. Best Time to Buy and Sell Stock with Cooldown Go Medium O(n) O(n)
322. Coin Change Go Medium O(n) O(n)
338. Counting Bits Go Medium O(n) O(n)
343. Integer Break Go Medium O(n^2) O(n)
357. Count Numbers with Unique Digits Go Medium O(1) O(1)
392. Is Subsequence Go Medium O(n) O(1)
416. Partition Equal Subset Sum Go Medium O(n^2) O(n)
714. Best Time to Buy and Sell Stock with Transaction Fee Go Medium O(n) O(1)
746. Min Cost Climbing Stairs Go Easy O(n) O(1)
838. Push Dominoes Go Medium O(n) O(1)
1025. Divisor Game Go Easy O(1) O(1)
891. Sum of Subsequence Widths Go Hard O(n) O(1)
942. DI String Match Go Easy O(n) O(1)
----------------------------------------------------------------- ------------- ------------- -------------------------- -------------------------- -------------

Depth-first Search

Title Solution Difficulty Time Space 收藏
98. Validate Binary Search Tree Go Medium O(n) O(1)
99. Recover Binary Search Tree Go Hard O(n) O(1)
100. Same Tree Go Easy O(n) O(1)
101. Symmetric Tree Go Easy O(n) O(1)
104. Maximum Depth of Binary Tree Go Easy O(n) O(1)
108. Convert Sorted Array to Binary Search Tree Go Easy O(n) O(1)
109. Convert Sorted List to Binary Search Tree Go Medium O(log n) O(n)
110. Balanced Binary Tree Go Easy O(n) O(1)
111. Minimum Depth of Binary Tree Go Easy O(n) O(1)
112. Path Sum Go Easy O(n) O(1)
113. Path Sum II Go Medium O(n) O(1)
114. Flatten Binary Tree to Linked List Go Medium O(n) O(1)
124. Binary Tree Maximum Path Sum Go Hard O(n) O(1)
129. Sum Root to Leaf Numbers Go Medium O(n) O(1)
199. Binary Tree Right Side View Go Medium O(n) O(1)
200. Number of Islands Go Medium O(n^2) O(n^2)
207. Course Schedule Go Medium O(n^2) O(n^2)
210. Course Schedule II Go Medium O(n^2) O(n^2)
257. Binary Tree Paths Go Easy O(n) O(1)
394. Decode String Go Medium O(n) O(n)
515. Find Largest Value in Each Tree Row Go Medium O(n) O(n)
542. 01 Matrix Go Medium O(n) O(1)
980. Unique Paths III Go Medium O(n log n) O(n)
----------------------------------------------------------------- ------------- ------------- -------------------------- -------------------------- -------------

Breadth-first Search

Title Solution Difficulty Time Space 收藏
101. Symmetric Tree Go Easy O(n) O(1)
102. Binary Tree Level Order Traversal Go Medium O(n) O(1)
103. Binary Tree Zigzag Level Order Traversal Go Medium O(n) O(n)
107. Binary Tree Level Order Traversal II Go Easy O(n) O(1)
111. Minimum Depth of Binary Tree Go Easy O(n) O(1)
126. Word Ladder II Go Hard O(n) O(n^2)
127. Word Ladder Go Medium O(n) O(n)
199. Binary Tree Right Side View Go Medium O(n) O(1)
200. Number of Islands Go Medium O(n^2) O(n^2)
207. Course Schedule Go Medium O(n^2) O(n^2)
210. Course Schedule II Go Medium O(n^2) O(n^2)
515. Find Largest Value in Each Tree Row Go Medium O(n) O(n)
542. 01 Matrix Go Medium O(n) O(1)
993. Cousins in Binary Tree Go Easy O(n) O(1)
----------------------------------------------------------------- ------------- ------------- -------------------------- -------------------------- -------------

Binary Search

Title Solution Difficulty Time Space 收藏
50. Pow(x, n) Go Medium O(log n) O(1)
69. Sqrt(x) Go Easy O(log n) O(1)
167. Two Sum II - Input array is sorted Go Easy O(n) O(1)
209. Minimum Size Subarray Sum Go Medium O(n) O(1)
222. Count Complete Tree Nodes Go Medium O(n) O(1)
230. Kth Smallest Element in a BST Go Medium O(n) O(1)
287. Find the Duplicate Number Go Easy O(n) O(1)
300. Longest Increasing Subsequence Go Medium O(n log n) O(n)
349. Intersection of Two Arrays Go Easy O(n) O(n)
350. Intersection of Two Arrays II Go Easy O(n) O(n)
392. Is Subsequence Go Medium O(n) O(1)
454. 4Sum II Go Medium O(n^2) O(n)
710. Random Pick with Blacklist Go Hard O(n) O(n)
----------------------------------------------------------------- ------------- ------------- -------------------------- -------------------------- -------------

Math

Title Solution Difficulty Time Space 收藏
2. Add Two Numbers Go Medium O(n) O(1)
50. Pow(x, n) Go Medium O(log n) O(1)
60. Permutation Sequence Go Medium O(n log n) O(1)
69. Sqrt(x) Go Easy O(log n) O(1)
202. Happy Number Go Easy O(log n) O(1)
224. Basic Calculator Go Hard O(n) O(n)
231. Power of Two Go Easy O(1) O(1)
263. Ugly Number Go Easy O(log n) O(1)
326. Power of Three Go Easy O(1) O(1)
343. Integer Break Go Medium O(n^2) O(n)
357. Count Numbers with Unique Digits Go Medium O(1) O(1)
628. Maximum Product of Three Numbers Go Easy O(n) O(1)
885. Spiral Matrix III Go Medium O(n^2) O(1)
891. Sum of Subsequence Widths Go Hard O(n) O(1)
942. DI String Match Go Easy O(n) O(1)
976. Largest Perimeter Triangle Go Easy O(n log n) O(log n)
996. Number of Squareful Arrays Go Hard O(n log n) O(n)
1025. Divisor Game Go Easy O(1) O(1)
----------------------------------------------------------------- ------------- ------------- -------------------------- -------------------------- -------------

Hash Table

Title Solution Difficulty Time Space 收藏
1. Two Sum Go Easy O(n) O(n)
3. Longest Substring Without Repeating Characters Go Medium O(n) O(1)
18. 4Sum Go Medium O(n^3) O(n^2) ❤️
30. Substring with Concatenation of All Words Go Hard O(n) O(n)
36. Valid Sudoku Go Medium O(n^2) O(n^2)
37. Sudoku Solver Go Hard O(n^2) O(n^2)
49. Group Anagrams Go Medium O(n log n) O(n)
76. Minimum Window Substring Go Hard O(n) O(n)
94. Binary Tree Inorder Traversal Go Medium O(n) O(1)
138. Copy List with Random Pointer Go Medium O(n) O(1)
202. Happy Number Go Easy O(log n) O(1)
205. Isomorphic Strings Go Easy O(log n) O(n)
217. Contains Duplicate Go Easy O(n) O(n)
219. Contains Duplicate II Go Easy O(n) O(n)
242. Valid Anagram Go Easy O(n) O(n)
274. H-Index Go Medium O(n) O(n)
290. Word Pattern Go Easy O(n) O(n)
347. Top K Frequent Elements Go Medium O(n) O(n)
349. Intersection of Two Arrays Go Easy O(n) O(n)
350. Intersection of Two Arrays II Go Easy O(n) O(n)
438. Find All Anagrams in a String Go Easy O(n) O(1)
447. Number of Boomerangs Go Easy O(n) O(1)
451. Sort Characters By Frequency Go Medium O(n log n) O(1)
454. 4Sum II Go Medium O(n^2) O(n)
648. Replace Words Go Medium O(n) O(n)
676. Implement Magic Dictionary Go Medium O(n) O(n)
720. Longest Word in Dictionary Go Easy O(n) O(n)
726. Number of Atoms Go Hard O(n) O(n)
739. Daily Temperatures Go Medium O(n) O(n)
710. Random Pick with Blacklist Go Hard O(n) O(n)
895. Maximum Frequency Stack Go Hard O(n) O(n)
930. Binary Subarrays With Sum Go Medium O(n) O(n)
992. Subarrays with K Different Integers Go Hard O(n) O(n)
----------------------------------------------------------------- ------------- ------------- -------------------------- -------------------------- -------------

Sort (已全部做完)

  • 深刻的理解多路快排。第 75 题。
  • 链表的排序,插入排序(第 147 题)和归并排序(第 148 题)
  • 桶排序和基数排序。第 164 题。
  • "摆动排序"。第 324 题。
  • 两两不相邻的排序。第 767 题,第 1054 题。
  • "饼子排序"。第 969 题。
Title Solution Difficulty Time Space 收藏
56. Merge Intervals Go Medium O(n log n) O(log n)
57. Insert Interval Go Hard O(n) O(1)
75. Sort Colors Go Medium O(n) O(1) ❤️
147. Insertion Sort List Go Medium O(n) O(1) ❤️
148. Sort List Go Medium O(n log n) O(log n) ❤️
164. Maximum Gap Go Hard O(n log n) O(log n) ❤️
179. Largest Number Go Medium O(n log n) O(log n) ❤️
220. Contains Duplicate III Go Medium O(n^2) O(1)
242. Valid Anagram Go Easy O(n) O(n)
274. H-Index Go Medium O(n) O(n)
324. Wiggle Sort II Go Medium O(n) O(n) ❤️
349. Intersection of Two Arrays Go Easy O(n) O(n)
350. Intersection of Two Arrays II Go Easy O(n) O(n)
524. Longest Word in Dictionary through Deleting Go Medium O(n) O(1)
767. Reorganize String Go Medium O(n log n) O(log n) ❤️
853. Car Fleet Go Medium O(n log n) O(log n)
710. Random Pick with Blacklist Go Hard O(n) O(n)
922. Sort Array By Parity II Go Easy O(n) O(1)
969. Pancake Sorting Go Medium O(n log n) O(log n) ❤️
973. K Closest Points to Origin Go Medium O(n log n) O(log n)
976. Largest Perimeter Triangle Go Easy O(n log n) O(log n)
1030. Matrix Cells in Distance Order Go Easy O(n^2) O(1)
1054. Distant Barcodes Go Medium O(n log n) O(log n)
----------------------------------------------------------------- ------------- ------------- -------------------------- -------------------------- -------------

About

✅ Solutions to LeetCode by Go

License:MIT License


Languages

Language:Go 100.0%