Skip to content

BenDeJonge/rust-leetcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

158 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

rust-leetcode

Just solvin' some LeetCode problems on the side in the best language in the world (fight me). Hopefully learning some DSA along the way!

My LeetCode profile.

Overview

Difficulty Solved
🟒 Easy 28
🟑 Medium 62
πŸ”΄ Hard 10
Total 100

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.

Problem list

🟒 Easy

Index Name Links Tags
0001 Two sum LeetCode, File array, hash table
0009 Palindrome number LeetCode, File math
0013 Roman to integer LeetCode, File hash table, math, string
0014 Longest common prefix LeetCode, File string, trie
0020 Valid parentheses LeetCode, File string, stack
0021 Merge two sorted lists LeetCode, File linked list, recursion
0026 Remove duplicates from sorted array LeetCode, File array, two pointers
0027 Remove elements LeetCode, File array, two pointers
0028 Find the index of the first occurence in a string LeetCode, File two pointers, string, string matching
0035 Search insert position LeetCode, File array, binary search
0070 Climbing stairs LeetCode, File math, dynamic programming, memoization
0094 Binary tree inorder traversal LeetCode, File stack, tree, depth-first search, binary tree
0101 Symmetric tree LeetCode, File tree, depth-firstsearch, breadth-first search, binary tree
0104 Maximum depth of binary tree LeetCode, File tree,depth-first search, breadth-first search, binary tree
0118 Pascals triangle LeetCode, File array, dynamic programming
0121 Best time to buy and sell stock LeetCode, File array, dynamic programming
0136 Single number LeetCode, File array, bit manipulation
0169 Majority element LeetCode, File array, hash table, divide and conquer, sorting, counting
0206 Reverse Linked List LeetCode, File linked-list, recursion
0226 Invert binary tree LeetCode, File tree, depth-first search, breadth-first search, binary tree
0234 Palindrome Linked List LeetCode, File linked-list, two-pointers, stack, recursion
0283 Move zeroes LeetCode, File array, two pointer
0448 Find All Numbers Disappeared in an Array LeetCode, File array, hash-table
0496 Next Greater Element I Leetcode, File array, hash-table, stack, monotonic-stack
0543 Diameter of a binary tree LeetCode, File tree, depth-first search, binary tree
0704 Binary search LeetCode, File array, binary search
1518 Water bottles LeetCode, File math, simulation
3617 Find the Original Typed String I LeetCode, File string

🟑 Medium

Index Name Links Tags
0002 Add two numbers LeetCode, File linked list, math, recursion
0003 Longest substring without repeating characters LeetCode, File hash table, string, sliding window
0005 Longest palindromic substring LeetCode, File two pointers, string, dynamic programming
0006 Zigzag Conversion Leetcode, File string
0011 Container with most water LeetCode, File array, two pointers, greedy
0015 3Sum LeetCode, File array, two pointers, sorting
0017 Letter combinations of a phone number LeetCode, File hash table, string, backtracking
0019 Remove Nth Node From End of List LeetCode, File linked-list, two-pointers
0022 Generate parentheses LeetCode, File string, dynamic programming, backtracking
0024 Swap Nodes in Pairs LeetCode, File linked-list, recursion
0031 Next Permutation LeetCode, File array, two-pointers
0033 Search in Rotated Sorted Array LeetCode, File array, binary-search
0034 Find First and Last Position of Element in Sorted Array LeetCode, File array, binary-search
0039 Combination Sum LeetCode, File array, binary-search
0045 Jump game II LeetCode, File array, dynamic programming, greedy
0046 Permutations LeetCode, File array, backtracking
0047 Permutations II LeetCode, File array, backtracking
0048 Rotate image LeetCode, File array, math, matrix
0049 Group anagrams LeetCode, File array, hash table, string, sorting
0053 Maximum Subarray LeetCode, File array, divide-and-conquer, dynamic-programming
0054 Spiral matrix LeetCode, File array, matrix, simulation
0055 Jump game LeetCode, File array, dynamic programming, greedy
0056 Merge Intervals LeetCode, File array, sorting
0062 Unique Paths LeetCode, File math, dynamic-programming, combinatorics
0064 Minimum Path Sum LeetCode, File array, dynamic-programming, matrix
0072 Edit Distance LeetCode, File string, dynamic-programming
0073 Set Matrix Zeroes LeetCode, File array, hash-table, matrix
0074 Search a 2D Matrix LeetCode, File array, binary-search, matrix
0075 Sort Colors LeetCode, File array, two-pointers, sorting
0078 Subsets LeetCode, File array, backtracking, bit-manipulation
0079 Word Search LeetCode, File array, string, backtracking, depth-first-search, matrix
0098 Validate Binary Search Tree Leetcode, File tree, depth-first-search, binary-search-tree, binary-tree
0102 Binary Tree Level Order Traversal Leetcode, File tree, breadth-first-search, binary-tree
0128 Longest Consecutive Sequence Leetcode, File array, hash-table, union-find
0131 Palindrome Partitioning LeetCode, File string, dynamic-programming, backtracking
0139 Word Break Leetcode, File array, hash-table, string, dynamic-programming, trie, memoization
0146 LRU Cache Leetcode, File hash-table, linked-list, design, doubly-linked-list
0153 Find Minimum in Rotated Sorted Array Leetcode, File array, binary-search
0167 Two sum ii LeetCode, File array, two pointers, binary search
0189 Rotate Array Leetcode, File array, math, two-pointers
0200 Number of Islands Leetcode, File array, depth-first-search, breadth-first-search, union-find, matrix
0215 Kth Largest Element in an Array Leetcode, File array, divide-and-conquer, sorting, heap-priority-queue, quickselect
0230 Kth Smallest Element in a BST Leetcode, File tree, depth-first-search, binary-search-tree, binary-tree
0238 Product of Array Except Self Leetcode, File array, prefix-sum
0240 Search a 2D Matrix II Leetcode, File array, binary-search, divide-and-conquer, matrix
0287 Find the Duplicate Number Leetcode, File array, two-pointers, binary-search, bit-manipulation
0319 Bulb Switcher LeetCode, File math, brainteaser
0322 Coin Change LeetCode, File array, dynamic-programming, breadth-first-search
0347 Top K Frequent Elements Leetcode, File array, hash-table, divide-and-conquer, sorting, heap-priority-queue, bucket-sort, counting, quickselect
0394 Decode String Leetcode, File string, stack, recursion
0438 Find All Anagrams in a String Leetcode, File hash-table, string, sliding-window
0442 Find All Duplicates in an Array LeetCode, File array, hash-table
0503 Next Greater Element II Leetcode, File array, stack, monotonic-stack
0556 Next Greater Element III Leetcode, File math, two-pointers, string
0560 Subarray Sum Equals K Leetcode, File array, hash-table, prefix-sum
0567 Permutation in String Leetcode, File hash-table, two-pointers, string, sliding-window
0739 Daily Temperatures LeetCode, File array, stack, monotonic-stack
1036 Rotting Oranges LeetCode, File array, breadth-first-search, matrix
1171 Shortest Path in Binary Matrix LeetCode, File array, breadth-first-search, matrix
1306 Jump Game III LeetCode, File array, depth-first-search, breadth-first-search
1456 Find the City With the Smallest Number of Neighbors at a Threshold Distance LeetCode, File dynamic-programming, graph, shortest-path
2001 Jump Game VII LeetCode, File string, dynamic-programming, sliding-window, prefix-sum

πŸ”΄ Hard

Index Name Links Tags
0004 Median of two sorted arrays LeetCode, File array, binary search, divide and conquer
0023 Merge k sorted lists LeetCode, File linked list, divide and conquer, heap (priority queue), merge sort
0032 Longest valid parentheses LeetCode, File string, dynamic programming, stack
0041 First Missing Positive LeetCode, File array, hash-table
0042 Trapping Rain Water LeetCode, File array, two pointer, dynamic programming, stack, monotonic stack
0051 N-Queens LeetCode, File array, backtracking
0052 N-Queens II LeetCode, File backtracking
0239 Sliding Window Maximum LeetCode, File array, queue, sliding-window, heap-priority-queue, monotonic-queue
0295 Find Median from Data Stream LeetCode, File two-pointers, design, sorting, heap-priority-queue, data-stream
1447 Jump Game IV LeetCode, File array, hash-table, breadth-first-search

About

My Leetcode solutions in Rust.

Topics

Resources

License

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages