Skip to content

eric100lin/Learn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Learn

Something I have learned...

Title Solution
Array
  1. 20.py Valid Parentheses (elegant coding)
  2. 38.py Count and Say (count consecutive elements)
  3. 42.py Trapping Rain Water (two pointers)
  4. 45.py Jump Game II (till and farest reach)
  5. 155.py Min Stack
  6. 209.py Summary Ranges (left pointer and accumulate)
  7. 217.py Contains Duplicate (set)
  8. 219.py Contains Duplicate II (just cares last)
  9. 228.py Summary Ranges (count consecutive elements)
  10. 238.py Product of Array Except Self (left2right, right2left)
  11. 242.py Valid Anagram (counter equality)
  12. 348.py Design Tic-Tac-Toe (diagonal math, sum, loop else)
  13. 349.py Intersection of Two Arrays (set & set)
  14. 350.py Intersection of Two Arrays II (counter & counter)
  15. 388.py Longest Absolute File Path (split, lstrip, memorization)
  16. 838.py Push Dominoes (force propagate/reset)
  17. 859.py Buddy Strings (enumerate cases)
  18. 1002.py Find Common Characters (counter & counter)
  19. 1122.py Relative Sort Array (counter, sort)
  20. 1169.py Invalid Transactions (permutations)
  21. 1170.py Compare Strings by Frequency of the Smallest Character (minmal counting)
  22. 1172.py Dinner Plate Stacks (heap, responsibilities)
  23. 1224.py Maximum Equal Frequency
  24. 1239.py Maximum Length of a Concatenated String with Unique Characters (set operation)
  25. 1247.py Minimum Swaps to Make Strings Equal (meaning of swap)
  26. 1260.py Shift 2D Grid (serialize and shift)
  27. 5181.py Distance Between Bus Stops
  28. 5222.py Split a String in Balanced Strings
Sort
  1. Sorting.py
  2. 15.py 3Sum (two pointers)
  3. 41.py First Missing Positive
  4. 49.py Group Anagrams
  5. 56.py Merge Intervals (lambda sort key)
  6. 75.py Sort Colors
  7. 220.py Contains Duplicate III
  8. 253.py Meeting Rooms II
  9. 295.py Find Median from Data Stream
  10. 539.py Minimum Time Difference
  11. 953.py Verifying an Alien Dictionary
  12. 1051.py Height Checker
Tree
  1. Traversal.py / BinarySearchTree.py / BinaryTreeProperty.py
  2. 98.py Validate Binary Search Tree (DFS min,max propagation)
  3. 102.py Binary Tree Level Order Traversal (BFS level propagation)
  4. 104.py Maximum Depth of Binary Tree (BFS level propagation)
  5. 105.py Construct Binary Tree from Preorder and Inorder Traversal (DFS .index and slice)
  6. 108.py Convert Sorted Array to Binary Search Tree (DFS mid and slice)
  7. 226.py Invert Binary Tree (DFS/BFS traversal)
  8. 250.py Count Univalue Subtrees (BFS&DFS check each subtrees)
  9. 333.py Largest BST Subtree (BFS&DFS check each subtrees, size in DFS/root in BFS)
  10. 863.py All Nodes Distance K in Binary Tree (DFS annotate parent, BFS condition traversal)
Graph
  1. Graph.py
  2. 200.py Number of Islands
  3. 1222.py Queens That Can Attack the King
LinkedList
  1. 19.py Remove Nth Node From End of List
  2. 141.py Linked List Cycle (slow/fast pointers)
  3. 206.py Reverse Linked List (prev/curr pointers)
  4. 160.py Intersection of Two Linked Lists
  5. 1171.py Remove Zero Sum Consecutive Nodes from Linked List
Dynamic Programming
  1. 55.py Jump Game
  2. 62.py Unique Paths
  3. 70.py Climbing Stairs
  4. 72.py Edit Distance
  5. 1223.py Dice Roll Simulation
Sub Array
Sub String
  1. 53.py Maximum Subarray (add or new subsum)
  2. 121.py Best Time to Buy and Sell Stock (just cares last)
  3. 152.py Maximum Product Subarray (min * negative)
  4. 386.py Longest Substring with At Most K Distinct Characters (just cares last, idx-left+1)
  5. 1233.py Remove Sub-Folders from the Filesystem (rfind, set lookup)
  6. 1248.py Count Number of Nice Subarrays (atMost(k)-atMost(k - 1))
Binary Search
  1. BinarySearchVariants.py
  2. 33.py Search in Rotated Sorted Array (check sorted part)
  3. 1237.py Find Positive Integer Solution for a Given Equation (search in constraint range)
Math
  1. The Aggregate Magic Algorithms
  2. 1.py Two Sum
  3. 7.py Reverse Integer (while != 0)
  4. 172.py Factorial Trailing Zeroes (while != 0)
  5. 224.py Basic Calculator
  6. 1071.py Greatest Common Divisor of Strings (GCD(b, a%b))
  7. 1232.py Check If It Is a Straight Line (dx1dy2=dy1dx2)
  8. 1238.py Circular Permutation in Binary Representation (gray code x ^ x>>1)
  9. 1262.py Greatest Sum Divisible by Three (modulo removal)
  10. 5183.py Day of the Week
  • Bash Reference Manual: link
Title Solution
Bash Builtin builtin.sh
Array Array.sh
Find Command find.sh
Title Solution
MRO

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages