Skip to content

Drscq/LCProblems

Repository files navigation

LCProblems

This repository records all the LeetCode Problems I prepared for internship.

Meta

Problem Technique
1 Two Sum Hash Map
31 Next Permutation Greedy, Two-pointers
34 Find First and Last Position of Element in Sorted Array Binary Search
50 Pow(x, n) Recursion, Binary Exponentiation
56 Merge Intervals Sorting, Greedy
71 Simplify Path Stack
88 Merge Sorted Array Two-pointers
125 Valid Palindrome Two-pointers
138 Copy List with Random Pointer Hash Map, Linked List
146 LRU Cache unordered_map, list
162 Find Peak Element Binary Search
199 Binary Tree Right Side View Depth-First Search
215 Kth Largest Element in an Array Sorting, Min-Heap
227 Basic Calculator II Stack
236 Lowest Common Ancestor of a Binary Tree Recursion
314 Binary Tree Vertical Order Traversal Breadth First Search
339 Nested List Weight Sum Depth-First Search
347 Top K Frequent Elements Heap, Hash Map
408 Valid Word Abbreviation ⭐ Two-pointers
528 Random Pick with Weight Prefix Sum, Binary Search
543 Diameter of Binary Tree Recursion
560 Subarray Sum Equals K Prefix Sum, Hash Map
670 Maximum Swap Greedy
680 Valid Palindrome II Two-pointers
791 Custom Sort String ⭐ Counting Sort, Hash Map
938 Range Sum of BST Depth-First Search
973 K Closest Points to Origin Sorting, Priority Queue
1091 Shortest Path in Binary Matrix Breadth-First Search
1249 Minimum Remove to Make Valid Parentheses Two Passes
1539 Kth Missing Positive Number Simulation, Hash Set
1570 Dot Product of Two Sparse Vectors Hash Map, List
1650 Lowest Common Ancestor of a Binary Tree III Parent Pointer
1762 Buildings With an Ocean View Reverse Scan, Suffix Max
2929 Distribute Candies Among Children II Mathematics

Google

Problem Notes
1 Two Sum Hash map
3 Longest Substring Without Repeating Characters Sliding window, hash map
5 Longest Palindromic Substring Expand-around-center, DP
9 Palindrome Number Math, string handling
10 Regular Expression Matching Dynamic Programming
11 Container With Most Water Two-pointers
15 3Sum hash, sorting
16 3Sum Closest Sorting, two-pointers
18 4Sum Hash, sorting, two-pointers
20 Valid Parentheses Stack
22 Generate Parentheses Backtracking
26 Remove Duplicates from Sorted Array Two-pointers
27 Remove Element Two-pointers
28 Find the index of the First Occurrence in a String String matching, KMP
31 Next Permutation Array, reverse suffix
33 Search in Rotated Sorted Array Modified binary search
37 Sudoku Solver Backtracking, constraint checking
42 Trapping Rain Water Two-pointers, monotonic stack
44 Wildcard Matching Dynamic Programming
45 Jump Game II Greedy
48 Rotate Image Matrix rotation, in-place
49 Group Anagrams Sorting, hash map
51 N-Queens Backtracking
53 Maximum Subarray Kadane's algorithm, divide and conquer
54 Spiral Matrix Simulation, boundaries
66 Plus One Array manipulation, carry
67 Add Binary String manipulation, carry
75 Sort Colors Dutch National Flag, two-pointers
92 Reverse Linked List II Linked list, in-place reversal
121 Best Time to Buy and Sell Stock One-pass, greedy
128 Longest Consecutive Sequence Hash set
152 Maximum Product Subarray Dynamic Programming
169 Majority Element Hash map, Boyer-Moore voting
175 Combine Two Tables SQL JOIN
189 Rotate Array Reverse, cycle replacement
198 House Robber Dynamic Programming
202 Happy Number Hash set, Floyd cycle detection
206 Reverse Linked List Iterative, recursive
231 Power of Two Bit manipulation
239 Sliding Window Maximum Monotonic deque, sliding window
283 Move Zeros Two-pointers, in-place
349 Intersection of Two Arrays Hash set
394 Decode String Stack, recursion
410 Split Array Largest Sum Binary search, greedy
560 Subarray Sum Equals K Prefix sum, hash map
584 Find Customer Referee SQL filtering, NULL handling
643 Maximum Average Subarray I Sliding window
796 Rotate String String manipulation, rotation check
875 Koko Eating Bananas Binary search
912 Sort an Array Merge sort, quicksort
1768 Merge Strings Alternately Two-pointers
2667 Create Hello World Function Closure, higher-order function

Uber

Problem Notes
2791 Count Paths That Can Form a Palindrome in a Tree Tree DFS, bitmask parity, prefix XOR
2858 Minimum Edge Reversals So Every Node is Reachable Rerooting DP, tree DP, DFS

About

This repository records all the LeetCode Problems I prepared for internship.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages