Skip to content

Everything related to algorithms and toy problems.

License

Notifications You must be signed in to change notification settings

sammndhr/algorithms

Repository files navigation

Algorithms

Everything related to algorithms, toy problems. Find Data Structures here--> github.com/mrinalini-m/data_structures

You can can search problems by tags or by name in my blog--> blog.mrinalini.dev

Usage

  1. Clone repo git clone https://github.com/mrinalini-m/algorithms.git
  2. To test individual problems: Eg, run node leetcode/array_string/0001_two_sum.js.

Note: List of problems in this README is NOT exhaustive.

Cracking the Coding Interview

Chapter 1 — Arrays and Strings

  1. Is Unique
  2. Check Permutation
  3. URLify
  4. Palindrome Permutation
  5. One Away
  6. String Compression
  7. Rotate Matrix
  8. Zero Matrix
  9. String Rotation

Chapter 2 — Linked Lists

  1. Remove Dups
  2. Return Kth to Last
  3. Delete Middle Node
  4. Partition
  5. Sum Lists
  6. Palindrome
  7. Intersection
  8. Loop Detection

Chapter 3 — Stacks and Queues

  1. Three in One
  2. Stack Min
  3. Stack of Plates
  4. Queue via Stacks
  5. Sort Stack
  6. Animal Shelter

Chapter 4 — Trees and Graphs

  1. Route Between Nodes
  2. Minimal Tree
  3. List of Depths
  4. Check Balanced
  5. Validate BST

Interview Cake

Chapter 1 - Array and string manipulation

  1. Merging Meeting Times
  2. Reverse String in Place
  3. Reverse Words
  4. Merge Sorted Arrays
  5. Cafe Order Checker

Chapter 2 - Hashing and hash tables

  1. Inflight Entertainment
  2. Permutation Palindrome
  3. Word Cloud Data
  4. Top Scores

Chapter 3 - Greedy algorithms

  1. Apple Stocks
  2. Highest Product of 3
  3. Product of All Other Numbers
  4. Cafe Order Checker
  5. In-Place Shuffle

Leetcode

Arrays and Strings

  1. 1. Two Sum
  2. 53. Maximum Subarray
  3. 20. Valid Parentheses
  4. 121. Best Time to Buy and Sell Stock
  5. 36. Valid Sudoku
  6. Find Longest Palindrome
  7. 544. Output Contest Matches
  8. 807. Max Increase to Keep City Skyline
  9. 91. Decode Ways
  10. 289. Game of Life
  11. 17. Letter Combinations of a Phone Number
  12. 6. ZigZag Conversion
  13. 974. Subarray Sums Divisible by K
  14. 739. Daily Temperatures
  15. 49. Group Anagrams
  16. 56. Merge Intervals
  17. 560. Subarray Sum Equals K
  18. 394. Decode String
  19. 179. Largest Number
  20. 79. Word Search
  21. 977. Squares of a Sorted Array
  22. 826. Most Profit Assigning Work
  23. 1091. Shortest Path in Binary Matrix
  24. 1057. Campus Bikes
  25. 695. Max Area of Island
  26. 3. Longest Substring Without Repeating Characters
  27. 973. k Closest Points

Lists

  1. 21. Merge Two Sorted Lists
  2. Clone Linked List
  3. 2. Add Two Numbers
  4. 1171. Remove Zero Sum Consecutive Nodes from Linked List
  5. 24. Swap Nodes in Pairs
  6. 138. Copy List with Random Pointer
  7. 1110. Delete Nodes And Return Forest
  8. 83. Remove Duplicates from Sorted List

Recursion

  1. 51. N-Queens
  2. 215. Kth Largest Element in an Array

Tree

  1. 199. Binary Tree Right Side View
  2. 700. Search in a Binary Search Tree
  3. 701. Insert into a Binary Search Tree
  4. 98. Validate Binary Search Tree
  5. 102. Binary Tree Level Order Traversal
  6. 109. Convert Sorted List to Binary Search Tree
  7. 863. All Nodes Distance K in Binary Tree
  8. 865. Smallest Subtree with all the Deepest Nodes

Graph

  1. 133. Clone Graph
  2. 547. Friend Circles
  3. 909. Snakes and Ladders
  4. 277. Find the Celebrity

Dynamic Programming

  1. 70. Climbing Stairs

Binary Search

  1. 875. Koko Eating Bananas

Others

  1. 29. Divide Two Integers
  2. 881. Boats to Save People
  3. 208. Implement Trie (Prefix Tree)
  4. 1007. Minimum Domino Rotations For Equal Row
  5. 1024. Video Stitching
  6. 841. Keys and Rooms

Releases

No releases published

Packages

No packages published