Skip to content

This is a js liabrary giving you useful everyday use fucntions.

License

Notifications You must be signed in to change notification settings

rajeshwar1993/useful

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GOOGLE DSA CHEATSHEET

These questions are intended for those who are preparing for Google.

S No Question Link Status Concept
1 Magic Squares In Grid Link PENDING Array
2 Longest Line of Consecutive One in Matrix Link PENDING Array
3 RLE Iterator Link PENDING Array
4 Snapshot Array Link PENDING Array
5 Maximum Sum of Two Non-Overlapping Subarrays Link PENDING Array
6 My Calendar I Link PENDING Array
7 Number of Matching Subsequences Link PENDING Array
8 Next Permutation Link PENDING Array
9 Add to Array-Form of Integer Link PENDING Array
10 Positions of Large Groups Link PENDING Array
11 Plus One Link DONE Array
12 Shortest Word Distance Link DONE Array
13 First Missing Positive Link PENDING Array
14 Majority Element II Link PENDING Array
15 Valid Mountain Array Link PENDING Array
16 Pascal's Triangle Link PENDING Array
17 Max Consecutive Ones Link DONE Array
18 Product of Array Except Self Link DONE Array
19 Shuffle an Array Link PENDING Array
20 Word Search Link PENDING ArrayBacktracking
21 Combination Sum III Link DONE ArrayBacktracking
22 Subsets Link DONE ArrayBacktrackingBit Manipulation
23 Maximum Side Length of a Square with Sum Less than or Equal to Threshold Link PENDING Array Binary Search
24 Find First and Last Position of Element in Sorted Array Link PENDING Array Binary Search
25 Search in Rotated Sorted Array Link PENDING Array Binary Search
26 Find Peak Element Link PENDING Array Binary Search
27 Find Minimum in Rotated Sorted Array Link PENDING Array Binary Search
28 Median of Two Sorted Arrays Link PENDING ArrayBinary SearchDivide and Conquer
29 Max Area of Island Link PENDING ArrayDepth-first Search
30 Product of the Last K Numbers Link PENDING ArrayDesign
31 Majority Element Link DONE ArrayDivide and ConquerBit Manipulation
32 Maximum Subarray Link PENDING ArrayDivide and ConquerDynamic Programming
33 Count Square Submatrices with All Ones Link PENDING ArrayDynamic Programming
34 Maximum Product Subarray Link DONE ArrayDynamic Programming
35 Maximum Sum of 3 Non-Overlapping Subarrays Link PENDING ArrayDynamic Programming
36 Minimum Path Sum Link DONE ArrayDynamic Programming
37 Best Time to Buy and Sell Stock Link PENDING ArrayDynamic Programming
38 Unique Paths Link DONE ArrayDynamic Programming
39 Maximum Points You Can Obtain from Cards Link PENDING ArrayDynamic ProgrammingSliding Window
40 Number of Submatrices That Sum to Target Link PENDING ArrayDynamic ProgrammingSliding Window
41 Divide Array in Sets of K Consecutive Numbers Link PENDING ArrayGreedy
42 Jump Game II Link PENDING ArrayGreedy
43 Minimum Domino Rotations For Equal Row Link PENDING ArrayGreedy
44 Task Scheduler Link PENDING ArrayGreedyQueue
45 Two Sum Link DONE ArrayHash Table
46 Subarray Sum Equals K Link PENDING ArrayHash Table
47 Contains Duplicate II Link PENDING ArrayHash Table
48 Insert Delete GetRandom O(1) Link PENDING ArrayHash TableDesign
49 Maximal Rectangle Link PENDING ArrayHash TableDynamic ProgrammingStack
50 X of a Kind in a Deck of Cards Link PENDING ArrayMath
51 Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit Link PENDING Array Sliding Window
52 Max Value of Equation Link PENDING Array Sliding Window
53 Insert Interval Link PENDING Array Sort
54 Merge Intervals Link PENDING Array Sort
55 Sum of Subarray Minimums Link PENDING Array Stack
56 Largest Rectangle in Histogram Link PENDING Array Stack
57 Compare Strings by Frequency of the Smallest Character Link PENDING ArrayString
58 Construct Binary Tree from Preorder and Inorder Traversal Link PENDING Array Tree Depth-first Search
59 Candy Crush Link PENDING ArrayTwo Pointers
60 3Sum Smaller Link PENDING ArrayTwo Pointers
61 3Sum Link PENDING ArrayTwo Pointers
62 Merge Sorted Array Link PENDING ArrayTwo Pointers
63 Move Zeroes Link DONE ArrayTwo Pointers
64 Remove Duplicates from Sorted Array Link PENDING ArrayTwo Pointers
65 Minimum Size Subarray Sum Link PENDING Array Two Pointers Binary Search
66 Longest Consecutive Sequence Link PENDING Array Union Find
67 Brace Expansion Link PENDING Backtracking
68 Palindrome Partitioning Link PENDING Backtracking
69 Combinations Link PENDING Backtracking
70 Permutations Link PENDING Backtracking
71 Unique Paths III Link PENDING BacktrackingDepth-first Search
72 Design Add and Search Words Data Structure Link PENDING BacktrackingDesignTrie
73 Word Search II Link PENDING BacktrackingTrie
74 Range Sum Query 2D - Mutable Link PENDING Binary Indexed Tree Segment Tree
75 Range Sum Query - Mutable Link PENDING Binary Indexed Tree Segment Tree
76 Missing Element in Sorted Array Link PENDING Binary Search
77 Online Election Link PENDING Binary Search
78 Find in Mountain Array Link PENDING Binary Search
79 First Bad Version Link PENDING Binary Search
80 Search a 2D Matrix II Link PENDING Binary SearchDivide and Conquer
81 Count of Smaller Numbers After Self Link PENDING Binary SearchDivide and ConquerSortBinary Indexed Tree Segment Tree
82 Dungeon Game Link PENDING Binary Search Dynamic Programming
83 Split Array Largest Sum Link PENDING Binary Search Dynamic Programming
84 Longest Increasing Subsequence Link PENDING Binary Search Dynamic Programming
85 Is Subsequence Link PENDING Binary Search Dynamic ProgrammingGreedy
86 Maximum Profit in Job Scheduling Link PENDING Binary Search Dynamic ProgrammingSort
87 Divide Chocolate Link PENDING Binary SearchGreedy
88 Kth Smallest Element in a Sorted Matrix Link PENDING Binary SearchHeap
89 Shortest Subarray with Sum at Least K Link PENDING Binary SearchQueue
90 Random Pick with Weight Link PENDING Binary SearchRandom
91 Count Complete Tree Nodes Link PENDING Binary SearchTree
92 Kth Smallest Element in a BST Link DONE Binary SearchTree
93 Maximum Score Words Formed by Letters Link PENDING Bit Manipulation
94 UTF-8 Validation Link PENDING Bit Manipulation
95 Single Number II Link PENDING Bit Manipulation
96 Swap Adjacent in LR String Link PENDING Brainteaser
97 Shortest Path in a Grid with Obstacles Elimination Link PENDING Breadth-first Search
98 Minimum Cost to Make at Least One Valid Path in a Grid Link PENDING Breadth-first Search
99 Jump Game IV Link PENDING Breadth-first Search
100 Open the Lock Link PENDING Breadth-first Search
101 Word Ladder Link PENDING Breadth-first Search
102 Minimum Knight Moves Link PENDING Breadth-first Search
103 Bus Routes Link PENDING Breadth-first Search
104 Walls and Gates Link DONE Breadth-first Search
105 Shortest Distance from All Buildings Link PENDING Breadth-first Search
106 As Far from Land as Possible Link PENDING Breadth-first SearchGraph
107 Nth Highest Salary Link PENDING Database
108 Combine Two Tables Link PENDING Database
109 Time Needed to Inform All Employees Link DONE Depth-first Search
110 Robot Room Cleaner Link PENDING Depth-first Search
111 24 Game Link PENDING Depth-first Search
112 Frog Position After T Seconds Link PENDING Depth-first Search
113 Number of Closed Islands Link PENDING Depth-first Search
114 Flood Fill Link PENDING Depth-first Search
115 Web Crawler Link PENDING Depth-first SearchBreadth-first Search
116 Pacific Atlantic Water Flow Link PENDING Depth-first SearchBreadth-first Search
117 Remove Invalid Parentheses Link PENDING Depth-first SearchBreadth-first Search
118 Clone Graph Link PENDING Depth-first SearchBreadth-first SearchGraph
119 Course Schedule II Link PENDING Depth-first SearchBreadth-first SearchGraphTopological Sort
120 Number of Islands Link PENDING Depth-first SearchBreadth-first SearchUnion Find
121 Number of Connected Components in an Undirected Graph Link DONE Depth-first SearchBreadth-first SearchUnion FindGraph
122 Possible Bipartition Link PENDING Depth-first SearchGraph
123 Reconstruct Itinerary Link PENDING Depth-first SearchGraph
124 Longest Increasing Path in a Matrix Link PENDING Depth-first SearchTopological SortMemoization
125 Accounts Merge Link PENDING Depth-first SearchUnion Find
126 LFU Cache Link PENDING Design
127 Design Hit Counter Link PENDING Design
128 Peeking Iterator Link PENDING Design
129 LRU Cache Link PENDING Design
130 Moving Average from Data Stream Link PENDING DesignQueue
131 Design Circular Queue Link PENDING DesignQueue
132 Design Search Autocomplete System Link PENDING DesignTrie
133 Implement Trie (Prefix Tree) Link PENDING DesignTrie
134 Expression Add Operators Link PENDING Divide and Conquer
135 Kth Largest Element in an Array Link PENDING Divide and ConquerHeap
136 The Skyline Problem Link PENDING Divide and ConquerHeapBinary Indexed Tree Segment TreeLine Sweep
137 Find Two Non-overlapping Sub-arrays Each With Target Sum Link PENDING Dynamic Programming
138 Encode String with Shortest Length Link PENDING Dynamic Programming
139 Student Attendance Record II Link PENDING Dynamic Programming
140 Number of Ways of Cutting a Pizza Link PENDING Dynamic Programming
141 Cherry Pickup II Link PENDING Dynamic Programming
142 Count Submatrices With All Ones Link PENDING Dynamic Programming
143 Stone Game III Link PENDING Dynamic Programming
144 Minimum Insertion Steps to Make a String Palindrome Link PENDING Dynamic Programming
145 Sentence Screen Fitting Link PENDING Dynamic Programming
146 Stone Game II Link PENDING Dynamic Programming
147 Dice Roll Simulation Link PENDING Dynamic Programming
148 Knight Probability in Chessboard Link PENDING Dynamic Programming
149 Matrix Block Sum Link PENDING Dynamic Programming
150 New 21 Game Link PENDING Dynamic Programming
151 Cherry Pickup Link PENDING Dynamic Programming
152 Longest Arithmetic Subsequence Link PENDING Dynamic Programming
153 Range Sum Query - Immutable Link PENDING Dynamic Programming
154 House Robber Link PENDING Dynamic Programming
155 Range Sum Query 2D - Immutable Link PENDING Dynamic Programming
156 Palindrome Partitioning II Link PENDING Dynamic Programming
157 Minimum Cost For Tickets Link PENDING Dynamic Programming
158 Maximal Square Link PENDING Dynamic Programming
159 Number of Dice Rolls With Target Sum Link DONE Dynamic Programming
160 Longest Common Subsequence Link PENDING Dynamic Programming
161 Best Time to Buy and Sell Stock IV Link PENDING Dynamic Programming
162 Coin Change Link PENDING Dynamic Programming
163 Word Break Link PENDING Dynamic Programming
164 Climbing Stairs Link PENDING Dynamic Programming
165 Coin Change 2 Link PENDING Dynamic Programming
166 Tiling a Rectangle with the Fewest Squares Link PENDING Dynamic ProgrammingBacktracking
167 Campus Bikes II Link PENDING Dynamic ProgrammingBacktracking
168 Android Unlock Patterns Link PENDING Dynamic ProgrammingBacktracking
169 Smallest Sufficient Team Link PENDING Dynamic ProgrammingBit Manipulation
170 The Most Similar Path in a Graph Link PENDING Dynamic ProgrammingGraph
171 Minimum Number of Taps to Open to Water a Garden Link PENDING Dynamic ProgrammingGreedy
172 Minimum Number of Refueling Stops Link PENDING Dynamic ProgrammingHeap
173 Guess Number Higher or Lower II Link PENDING Dynamic ProgrammingMinimax
174 Partition to K Equal Sum Subsets Link PENDING Dynamic ProgrammingRecursion
175 Minimum Window Subsequence Link PENDING Dynamic ProgrammingSliding Window
176 Unique Binary Search Trees Link PENDING Dynamic ProgrammingTree
177 Binary Tree Cameras Link PENDING Dynamic ProgrammingTreeDepth-first Search
178 String Transforms Into Another String Link PENDING Graph
179 Sequence Reconstruction Link PENDING GraphTopological Sort
180 Alien Dictionary Link PENDING GraphTopological Sort
181 Two City Scheduling Link PENDING Greedy
182 Course Schedule III Link PENDING Greedy
183 Queue Reconstruction by Height Link PENDING Greedy
184 Non-overlapping Intervals Link PENDING Greedy
185 Gas Station Link PENDING Greedy
186 Increasing Triplet Subsequence Link PENDING Greedy
187 Minimum Number of K Consecutive Bit Flips Link PENDING GreedySliding Window
188 Campus Bikes Link PENDING GreedySort
189 Bulls and Cows Link PENDING Hash Table
190 Valid Sudoku Link PENDING Hash Table
191 Isomorphic Strings Link DONE Hash Table
192 Find All Anagrams in a String Link PENDING Hash Table
193 Island Perimeter Link DONE Hash Table
194 Jewels and Stones Link PENDING Hash Table
195 Sudoku Solver Link PENDING Hash TableBacktracking
196 Time Based Key-Value Store Link PENDING Hash TableBinary Search
197 4Sum II Link PENDING Hash TableBinary Search
198 Find the Difference Link DONE Hash TableBit Manipulation
199 Employee Importance Link PENDING Hash TableDepth-first SearchBreadth-first Search
200 Logger Rate Limiter Link PENDING Hash TableDesign
201 Design HashMap Link PENDING Hash TableDesign
202 Longest String Chain Link PENDING Hash TableDynamic Programming
203 Top K Frequent Elements Link PENDING Hash TableHeap
204 Top K Frequent Words Link PENDING Hash TableHeapTrie
205 Max Points on a Line Link PENDING Hash TableMath
206 Encode and Decode TinyURL Link PENDING Hash TableMath
207 Count Primes Link PENDING Hash TableMath
208 Happy Number Link PENDING Hash TableMath
209 H-Index Link DONE Hash TableSort
210 Valid Anagram Link PENDING Hash TableSort
211 Design A Leaderboard Link PENDING Hash TableSortDesign
212 Daily Temperatures Link PENDING Hash TableStack
213 Number of Atoms Link PENDING Hash TableStackRecursion
214 Alphabet Board Path Link PENDING Hash TableString
215 Find Duplicate File in System Link PENDING Hash TableString
216 Group Shifted Strings Link PENDING Hash TableString
217 First Unique Character in a String Link PENDING Hash TableString
218 Group Anagrams Link PENDING Hash TableString
219 Longest Substring with At Most K Distinct Characters Link PENDING Hash TableStringSliding Window
220 Vertical Order Traversal of a Binary Tree Link DONE Hash TableTree
221 Intersection of Two Arrays II Link PENDING Hash TableTwo PointersBinary SearchSort
222 Subarrays with K Different Integers Link PENDING Hash TableTwo PointersSliding Window
223 Longest Substring with At Most Two Distinct Characters Link PENDING Hash TableTwo PointersStringSliding Window
224 Minimum Window Substring Link PENDING Hash TableTwo PointersStringSliding Window
225 Longest Substring Without Repeating Characters Link PENDING Hash TableTwo PointersStringSliding Window
226 Minimum Cost to Hire K Workers Link PENDING Heap
227 Strong Password Checker Link PENDING Heap
228 Network Delay Time Link PENDING HeapDepth-first SearchBreadth-first SearchGraph
229 Find Median from Data Stream Link PENDING HeapDesign
230 Kth Largest Element in a Stream Link DONE HeapDesign
231 Split Array into Consecutive Subsequences Link PENDING HeapGreedy
232 Employee Free Time Link PENDING HeapGreedy
233 Meeting Rooms II Link DONE HeapGreedySort
234 Sliding Window Maximum Link PENDING HeapSliding Window
235 Meeting Scheduler Link PENDING Line Sweep
236 Merge Two Sorted Lists Link PENDING Linked List
237 Reverse Linked List Link PENDING Linked List
238 Reverse Linked List II Link PENDING Linked List
239 Odd Even Linked List Link PENDING Linked List
240 Swap Nodes in Pairs Link PENDING Linked List
241 Intersection of Two Linked Lists Link PENDING Linked List
242 Convert Sorted List to Binary Search Tree Link PENDING Linked List Depth-first Search
243 Merge k Sorted Lists Link PENDING Linked List Divide and ConquerHeap
244 Add Two Numbers Link PENDING Linked ListMath
245 Palindrome Linked List Link PENDING Linked List Two Pointers
246 Self Crossing Link PENDING Math
247 Valid Square Link PENDING Math
248 Largest Time for Given Digits Link PENDING Math
249 Excel Sheet Column Title Link PENDING Math
250 Palindrome Number Link PENDING Math
251 Excel Sheet Column Number Link PENDING Math
252 Optimal Account Balancing Link PENDING Math
253 Permutation Sequence Link PENDING MathBacktracking
254 Find Positive Integer Solution for a Given Equation Link PENDING MathBinary Search
255 Pow(x, n) Link PENDING MathBinary Search
256 Cracking the Safe Link PENDING MathDepth-first Search
257 Longest Arithmetic Subsequence of Given Difference Link PENDING MathDynamic Programming
258 Integer Break Link PENDING MathDynamic Programming
259 Perfect Squares Link PENDING MathDynamic ProgrammingBreadth-first Search
260 Minimum Area Rectangle II Link PENDING MathGeometry
261 Strobogrammatic Number II Link PENDING MathRecursion
262 Basic Calculator Link PENDING MathStack
263 Multiply Strings Link PENDING MathString
264 Guess the Word Link PENDING Minimax
265 Hand of Straights Link PENDING Ordered Map
266 Range Module Link PENDING Segment TreeOrdered Map
267 Sliding Window Median Link PENDING Sliding Window
268 Validate Stack Sequences Link PENDING Stack
269 Exclusive Time of Functions Link PENDING Stack
270 Remove Outermost Parentheses Link PENDING Stack
271 Online Stock Span Link PENDING Stack
272 Baseball Game Link PENDING Stack
273 Remove All Adjacent Duplicates in String II Link PENDING Stack
274 Evaluate Reverse Polish Notation Link PENDING Stack
275 Remove All Adjacent Duplicates In String Link PENDING Stack
276 Asteroid Collision Link PENDING Stack
277 Decode String Link PENDING StackDepth-first Search
278 Binary Tree Zigzag Level Order Traversal Link PENDING StackTreeBreadth-first Search
279 Expressive Words Link PENDING String
280 Find And Replace in String Link PENDING String
281 Remove Comments Link PENDING String
282 Longest Repeating Substring Link PENDING String
283 Read N Characters Given Read4 Link PENDING String
284 Compare Version Numbers Link DONE String
285 Text Justification Link PENDING String
286 Read N Characters Given Read4 II - Call multiple times Link PENDING String
287 Repeated String Match Link DONE String
288 Rearrange Spaces Between Words Link PENDING String
289 Shortest Palindrome Link PENDING String
290 Custom Sort String Link PENDING String
291 Count and Say Link PENDING String
292 Repeated Substring Pattern Link PENDING String
293 Add Strings Link PENDING String
294 Longest Common Prefix Link PENDING String
295 Length of Last Word Link PENDING String
296 Letter Combinations of a Phone Number Link DONE StringBacktracking
297 Generate Parentheses Link PENDING StringBacktracking
298 Edit Distance Link PENDING StringDynamic Programming
299 Longest Palindromic Substring Link DONE StringDynamic Programming
300 Palindromic Substrings Link PENDING StringDynamic Programming
301 Decode Ways Link PENDING StringDynamic Programming
302 Regular Expression Matching Link PENDING StringDynamic ProgrammingBacktracking
303 Wildcard Matching Link PENDING StringDynamic ProgrammingBacktrackingGreedy
304 Reorganize String Link PENDING StringHeapGreedySort
305 Word Abbreviation Link PENDING StringSort
306 Valid Parentheses Link DONE StringStack
307 Serialize and Deserialize N-ary Tree Link PENDING Tree
308 Flip Equivalent Binary Trees Link PENDING Tree
309 Find Duplicate Subtrees Link PENDING Tree
310 Invert Binary Tree Link PENDING Tree
311 Count Univalue Subtrees Link PENDING Tree
312 Lowest Common Ancestor of a Binary Tree Link PENDING Tree
313 Diameter of Binary Tree Link PENDING Tree
314 Delete Nodes And Return Forest Link PENDING TreeDepth-first Search
315 Reorder Routes to Make All Paths Lead to the City Zero Link PENDING TreeDepth-first Search
316 House Robber III Link PENDING TreeDepth-first Search
317 Binary Tree Coloring Game Link PENDING TreeDepth-first Search
318 Binary Tree Maximum Path Sum Link DONE TreeDepth-first Search
319 Distribute Coins in Binary Tree Link PENDING TreeDepth-first Search
320 Balanced Binary Tree Link PENDING TreeDepth-first Search
321 Recover Binary Search Tree Link PENDING TreeDepth-first Search
322 Maximum Difference Between Node and Ancestor Link DONE TreeDepth-first Search
323 Populating Next Right Pointers in Each Node II Link PENDING TreeDepth-first Search
324 Path Sum II Link PENDING TreeDepth-first Search
325 Flatten Binary Tree to Linked List [Link]( https://leetcode.com/problems/flatten-binary-tree-to- Linked List ) PENDING
326 Populating Next Right Pointers in Each Node Link PENDING TreeDepth-first Search
327 Maximum Depth of Binary Tree Link PENDING TreeDepth-first Search
328 Validate Binary Search Tree Link PENDING TreeDepth-first Search
329 Maximum Depth of N-ary Tree Link PENDING TreeDepth-first SearchBreadth-first Search
330 Symmetric Tree Link PENDING TreeDepth-first SearchBreadth-first Search
331 All Nodes Distance K in Binary Tree Link PENDING TreeDepth-first SearchBreadth-first Search
332 Serialize and Deserialize Binary Tree Link PENDING TreeDesign
333 All Possible Full Binary Trees Link PENDING TreeRecursion
334 Stream of Characters Link PENDING Trie
335 Fruit Into Baskets Link PENDING Two Pointers
336 Backspace String Compare Link PENDING Two PointersStack
337 Evaluate Division Link PENDING Union FindGraph

Disclaimer : It does not have any connection with Google as a company.

About

This is a js liabrary giving you useful everyday use fucntions.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published