Just solvin' some LeetCode problems on the side in the best language in the world (fight me). Hopefully learning some DSA along the way!
| Difficulty | Solved | |
|---|---|---|
| 🟢 | Easy | 27 |
| 🟡 | Medium | 37 |
| 🔴 | Hard | 8 |
| Total | 72 |
A fetcher module is available to make web requests to LeetCode to automatically pull in question data and create local resources.
$ cargo run fetch <problem-name>
Here, the problem name can be obtained from the URL:
https://leetcode.com/problems/<problem-name>/. Typically, this is simply the
title in lowercase with spaces replaced by dashes.
| Index | Name | Tags |
|---|---|---|
| 0001 | Two sum | array, hash table |
| 0009 | Palindrome numbers | math |
| 0013 | Roman to integers | hash table, math, string |
| 0014 | Longest common prefix | string, trie |
| 0020 | Valid parentheses | string, stack |
| 0021 | Merge two sorted lists | linked list, recursion |
| 0026 | Remove duplicates from sorted array | array, two pointers |
| 0027 | Remove elements | array, two pointers |
| 0028 | Find the index of the first occurence in a string | two pointers, string, string matching |
| 0035 | Search insert position | array, binary search |
| 0070 | Climbing stairs | math, dynamic programming, memoization |
| 0094 | Binary tree inorder traversal | stack, tree, depth-first search, binary tree |
| 0101 | Symmetric tree | tree, depth-first search, breadth-first search, binary tree |
| 0104 | Maximum depth of binary tree | tree, depth-first search, breadth-first search, binary tree |
| 0118 | Pascals triangle | array, dynamic programming |
| 0121 | Best time to buy and sell stock | array, dynamic programming |
| 0136 | Single number | array, bit manipulation |
| 0169 | Majority element | array, hash table, divide and conquer, sorting, counting |
| 0206 | Reverse Linked List | linked-list, recursion |
| 0226 | Invert binary tree | tree, depth-first search, breadth-first search, binary tree |
| 0234 | Palindrome Linked List | linked-list, two-pointers, stack, recursion |
| 0283 | Move zeroes | array, two pointer |
| 0448 | Find All Numbers Disappeared in an Array | array, hash-table |
| 0543 | Diameter of a binary tree | tree, depth-first search, binary tree |
| 0704 | Binary search | array, binary search |
| 1518 | Water bottles | math, simulation |
| 3617 | Find the Original Typed String I | string |
| Index | Name | Tags |
|---|---|---|
| 0002 | Add two numbers | linked list, math, recursion |
| 0003 | Longest substring without repeating characters | hash table, string, sliding window |
| 0005 | Longest palindromic substring | two pointers, string, dynamic programming |
| 0011 | Container with the most water | array, two pointers, greedy |
| 0015 | 3Sum | array, two pointers, sorting |
| 0017 | Letter combinations of a phone number | hash table, string, backtracking |
| 0019 | Remove Nth Node From End of List | linked-list, two-pointers |
| 0022 | Generate parentheses | string, dynamic programming, backtracking |
| 0024 | Swap Nodes in Pairs | linked-list, recursion |
| 0031 | Next Permutation | array, two-pointers |
| 0033 | Search in Rotated Sorted Array | array, binary-search |
| 0034 | Find First and Last Position of Element in Sorted Array | array, binary-search |
| 0045 | Jump game II | array, dynamic programming, greedy |
| 0046 | Permutations | array, backtracking |
| 0047 | Permutations II | array, backtracking |
| 0048 | Rotate image | array, math, matrix |
| 0049 | Group anagrams | array, hash table, string, sorting |
| 0053 | Maximum Subarray | array, divide-and-conquer, dynamic-programming |
| 0054 | Spiral matrix | array, matrix, simulation |
| 0055 | Jump game | array, dynamic programming, greedy |
| 0056 | Merge Intervals | array, sorting |
| 0056 | Merge Intervals | array, sorting |
| 0062 | Unique Paths | math, dynamic-programming, combinatorics |
| 0064 | Minimum Path Sum | array, dynamic-programming, matrix |
| 0072 | Edit Distance | string, dynamic-programming |
| 0074 | Search a 2D Matrix | array, binary-search, matrix |
| 0078 | Subsets | array, backtracking, bit-manipulation |
| 0079 | Word Search | array, string, backtracking, depth-first-search, matrix |
| 0131 | Palindrome Partitioning | string, dynamic-programming, backtracking |
| 0167 | Two sum ii | array, two pointers, binary search |
| 0319 | Bulb Switcher | math, brainteaser |
| 0322 | Coin Change | array, dynamic-programming, breadth-first-search |
| 0442 | Find All Duplicates in an Array | array, hash-table |
| 1171 | Shortest Path in Binary Matrix | array, breadth-first-search, matrix |
| 1306 | Jump Game III | array, depth-first-search, breadth-first-search |
| 1456 | Find the City With the Smallest Number of Neighbors at a Threshold Distance | dynamic-programming, graph, shortest-path |
| 2001 | Jump Game VII | string, dynamic-programming, sliding-window, prefix-sum |
| Index | Name | Tags |
|---|---|---|
| 0004 | Median of two sorted arrays | array, binary search, divide and conquer |
| 0023 | Merge k sorted lists | linked list, divide and conquer, heap (priority queue), merge sort |
| 0032 | Longest valid parentheses | string, dynamic programming, stack |
| 0041 | First Missing Positive | array, hash-table |
| 0042 | Longest valid parentheses | array, two pointer, dynamic programming, stack, monotonic stack |
| 0051 | N-Queens | array, backtracking |
| 0052 | N-Queens II | backtracking |
| 1447 | Jump Game IV | array, hash-table, breadth-first-search |