Categorygithub.com/catorpilor/leetcode
module
0.0.0-20241109161655-a9aeda48cc7a
Repository: https://github.com/catorpilor/leetcode.git
Documentation: pkg.go.dev

# README

LeetCode

My submissions for LeetCode Oj.

Tags

Categories

Array

TitleSolutionDifficulty
1. Two Sumuse hashmapEasy
719. Find K-th Smallest Pair DistanceBucket Sort, Binary SearchHard
581. Shortest Unsorted Continuous Subarrayfour passesEasy
34. Find First and Last Position of Element in Sorted Arrayuse lowerBoundMedium
238. Product of Array Except Selfuse two additional product arrayMedium
283. Move Zerosuse two pointersEasy
215. Kth Largest Element in an Arrayuse sortMedium
26. Remove Duplicates from Sorted Arraysimple traverseEasy
135. Candyuse one array two passesHard
1046. Last Stone Weightuse bucketEasy
1424. Diagonal Traverse IIuse #hashmapMedium
278. First Bad Versionuse binary searchEasy
739. Daily Temperaturesuse stackMedium
1277. Count Square Submatrices with All Onesuse dpMedium
1035. Uncrossed Linesuse dp same approach as longest common sequencesMedium
1338. Reduce Array Size to The Halfuse hashmapMedium
368. Largest Divisible Subsetuse dpMedium
1535. Find the Winner of an Array Gameuse one pass with constant spaceMedium

Bit

TitleSolutionDifficulty
342. Power Of FourUse loop, Bit ManipulationEasy
136. Single NumberxorEasy

Linked List

TitleSolutionDifficulty
148. Sort ListBottom Up Merge SortMedium
92. Reverse Linked List IIUse Dummmy node to iterator the listMedium
2. Add Two NumbereUse Sentinel NodeMedium
21. Merge Two Sorted ListUsing golang channelEasy
23. Merge K Sorted ListsDivide and ConquerHard
138. Copy List With Random PointerExtend List with copied NodesMedium
141. Linked List CycleTwo PointersEasy
24. Swap Nodes In PairsUse dummy node to iterator the listMedium
234. Palindrome Linked ListTwo PointersEasy
328. Odd Even Linked Listdummy nodeMedium
147. Insertion Sort Listdummy nodeMedium
445. Add Two Numbers IIreverse the listMedium
143. Reorder ListTwo PointersMedium
19. Remove Nth Node from end of ListTwo Pointers with n+1 gapMedium
86. Partition ListTwo pointersMedium
369. Plus One Linked ListDummy NodeMedium
82. Remove Duplicates From Sorted Linkde List IIDummy Node with recursive helper func, Dummy Node in placeMedium
876. Middle of the Linked ListTwo PointersEasy
61. Rotate Listreverse listMedium
1171. Remove Zero Sum Consecutive Nodes from Linked ListTwo passes preSum with hashmapMedium
25. Reverse Nodes in k-Groupsusing iteratorHard
1290. Convert Binary Number to Integerstrconv.ParseUInt's implementationEasy
707. Design Linked ListSingle Linked List with CountMedium
725. Split Linked List In PartsTwo passesMedium
817. Linked List Componentsiterator+setMedium
430. Flatten a Multilevel Doubly Linked ListpreOrder use recursionMedium
426. Convert Binary Search Tree to Sorted Doubly Linked ListinOrder traversal using stackMedium

Sliding Window

TitleSolutionDifficulty
719. Find K-th Smallest Pair DistanceBinary Search+Sliding WindowHard

Stack

TitleSolutionDifficulty
636. Exclusive Time of FunctionsUse stack to track function idMedium
394. Decode Stringuse two stacksMedium
901. Online Stock Spanuse stackMedium

HashMap

TitleSolutionDifficulty
1048. Longest String Chainhashmap + DFS + MemorizationMedium
36. Valid Sudokuuse hashmapsMedium
380. Insert Delete GetRandom O(1)hashmap and arrayMedium
381. Insert Delete GetRandom O(1) - Duplicates alloweduse hashmap and unordered_setHard
525. Contiguous Arrayuse hashmapMedium
560. Subarray Sum Equals Kuse hashmapMedium

Breadth First Search

TitleSolutionDifficulty
200. Number OfIslandsuse BFSMedium

Depth First Search

TitleSolutionDifficulty
200. Number OfIslandsuse DFSMedium
100. Same Treeuse DFSEasy
101. Symmeetric Treeuse DFSEasy
104. Max Depth of Binary TreeDFSEasy
124. Binary Tree Maximum Path Sumuse DFS and a global maxHard
1192. Critical Connections in a NetworkTarjan's algorithmHard
301. Remove Invalid Parenthesesuse backtrackingHard
105. Construct Binary Tree from Preorder and Inorder Traversaluse DFSMedium
106. Construct Binary Tree From Inorder and Postorder Traversaluse DFSMedium
1026. Maximum Difference Between Node and Ancestoruse dfs with min and max nodeMedium
1008. Construct Binary Search Tree from Preorder Traversaluse dfs with sliced ordersMedium
993. Cousins in Binary Treeuse dfsEasy

Heap

TitleSolutionDifficulty
973. K Closest Points to Originuse max-k-heap, use quick selectMedium

Random

TitleSolutionDifficulty
528. Random Pick with Weightuse rand.Intn and binary searchMedium

DP

TitleSolutionDifficulty
123. Best Time to Buy and Sell Stock IIIuse dp[k][j] to represent at day j's max profit with at most k transactionsHard
97. Interleaving StringUse a 2D array, dp[i][j] represents whether s1[:i], s2[:j] and s3[:i+j] are interleaving stringsHard
64. Minimum Path Sumdp[i] = min(dp[i],dp[i-1]) + grid[j][i]Medium
1143. Longest Common Subsequenceuse dp with less spaceMedium

Design

TitleSolutionDifficulty
146. LRU Cacheuse doubly linked list with hashmapMedium

Binary Search

TitleSolutionDifficulty
5. Longest Palindromic Substringparity binary searchMeidum
33. Search in Rotated Sorted Arrayuse binary search with one passMedium
202. Happy Numberuse floyed's algorithmEasy
Leftmost Column with at least a Oneuse binary search (lower bound)Meidum
540. Single Element in a Sorted Arrayuse binary searchMedium
1231. Divide Chocolateanswer in the range min(chocolate), sum(chocolate)Medium

String

TitleSolutionDifficulty
844. Backspace String Compareuse two pointersEasy
316. Remove Duplicate Lettersuse stack and hashmapHard
678. Valid Parenthesis StringgreedyMedium
771. Jewels and Stonesuse #hashmapEasy
383. Ransom Noteuse hashmapEasy
402. Remove K Digitsuse greedy with stackMedium
451. Sort Characters By Frequencyuse hashmapMedium
856. Score of Parenthesesuse stack to store the scoreMedium
1455. Check If a Word Occurs As a Prefix of Any Word in a Sentenceonepass use strings.Fields and strings.HasPrefixEasy
1456. Maximum Number of Vowels in a Substring of Given Lengthuse slide windowMedium

Tree

TitleSolutionDifficulty
1457. Pseudo-Palindromic Paths in a Binary Treeuse backtrackingMeidum
1466. Reorder Routes to Make All Paths Lead to the City Zeroconvert to a tree like problem then use dfsMedium
236. Lowest Common Ancestor of a Binary Treeuse dfsMedium

Graph

TitleSolutionDifficulty
1462. Course Schedule IVuse floyd wrashallMedium

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author