/leetcode-rust

My solutions to leetcode problems written in rust-lang

Primary LanguageRustMIT LicenseMIT


Logo

Open Source Love Language  License  Update 

A repo for all the leetcode problems that I have solved using rust-lang. Note that the solutions might not be as rust idiomatic as they could be for I have solved them while beginning to explore rust world.

Polynomial time is great. OK? Exponential time is bad. And infinite time gets you fired.

-- Prof. Srini Devadas

Stats

Leetcode Stats

Problems

Easy

# Title Solution Quick notes Analysis Time Space
1832 Check if the Sentence Is Pangram Rust Use a Hash Set to keep track of the characters seen. O(n) O(1)

Medium

# Title Solution Quick notes Analysis Time Space
64 Minimum Path Sum Rust Use dynamic programming to find the minimum path among all possible paths before the current state and then add the value for the current state. Medium
120 Triangle Rust Dynamic programming pattern of finding the minimum path similar to p64. Medium
162 Find Peak Element Rust Use binary search with a left and right index. Medium
416 Partition Equal Subset Sum Rust Dynamic Programming 📝 Medium

Hard

# Title Solution Quick notes Analysis Time Space
51 N-Queens - II Rust Backtracking
52 N-Queens Rust Backtracking
174 Dungeon Game Rust Dynamic programming pattern similar to p64. Hard
920 Number of Music Playlists Rust Dynamic Programming 📝 Hard