-
Notifications
You must be signed in to change notification settings - Fork 10
Home
Priyanka Khire edited this page May 14, 2024
·
65 revisions
Problem | Solution with time and space complexity | Resources | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
DFS |
|
YouTube Video | |||||||||||||||
BFS |
|
YouTube Video | |||||||||||||||
Topological Sort |
|
The provided approaches only work if the graph is directed and acyclic. YouTube Video |
|||||||||||||||
Heap Sort |
|
Problem | Solution with time and space complexity | Resources | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Two Sum |
|
Resources | ||||||||||||
Group Anagrams |
|
Resources | ||||||||||||
Merge Sorted Arrays |
|
|||||||||||||
Remove Element |
|
|||||||||||||
Contains Duplicate |
|
Resources | ||||||||||||
Valid Anagram |
|
Resources | ||||||||||||
Top K Frequent Elements |
|
Resources | ||||||||||||
Product of Array Except Self |
|
Resources | ||||||||||||
Pascal's Triangle |
|
Resources | ||||||||||||
Pascal's Triangle II |
|
Resources |
Problem | Solution with time and space complexity | Resources | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Generate all permutations of a string |
|
YouTube Video | |||||||||||||||
Given an array with unique elements, generate all sub arrays from that array |
|
||||||||||||||||
Word Search |
|
Don't forget to mark cells visited | |||||||||||||||
Word Search II |
|
Use Tries if you want to reduce the time complexity | |||||||||||||||
Vowels of All Substrings |
|
-
What are some ways of representing graph in code ?
- Matrix
A B C A 0 1 0 B 0 0 1 C 1 0 0 - Adjacency List
Using Hash Map: {
A:B,
B:C,
C:A }
Visit here to understand better - Linked List
Problem | Solution with time and space complexity | Resources | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Course Schedule |
|
Use Topological Sorting |
Problem | Solution with time and space complexity | Resources | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Logger Rate Limiter |
|
||||||||||
Subdomain Visit Count |
|
Resources |
Problem | Solution with time and space complexity | Resources | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Minimum Number of Taps to Open to Water a Garden |
|
Resources | ||||||||||||
Minimum number of intervals to cover the target interval |
|
Resources | ||||||||||||
Meeting Rooms II |
|
Use Min Heap |
Problem | Solution with time and space complexity | Resources | ||||||
---|---|---|---|---|---|---|---|---|
Print all prime factors of a number |
|
Resources |
Problem | Solution with time and space complexity | Resources | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Valid Sudoku |
|
|||||||||||||||||||
Number of Islands |
|
Resources | ||||||||||||||||||
Max Area of Island |
|
Resources |
Problem | Solution with time and space complexity | Resources | ||||||
---|---|---|---|---|---|---|---|---|
Rank Teams by Votes |
|
Took help of chatGPT and algo monster |
Problem | Solution with time and space complexity | Resources | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Minimum Remove to Make Valid Parentheses |
|
Resources |
Problem | Solution with time and space complexity | Resources | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Maximum Average Subtree |
|
Resources | ||||||||||||
Serialize and Deserialize N-ary Tree |
|
Geeks for Geeks | ||||||||||||
Construct Binary Tree from Preorder and Inorder Traversal |
|
Resources |
Problem | Solution with time and space complexity | Resources | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Implement Trie (Prefix Tree) |
|
Leetcode editorial |
Problem | Solution with time and space complexity | Resources | ||||||
---|---|---|---|---|---|---|---|---|
Valid Palindrome |
|
|||||||
Is Subsequence |
|