Skip to content

About

Python solutions to NeetCode data structures & algorithms problems.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

15 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

NeetCode Solutions

My Python solutions to NeetCode data structures and algorithms problems, synced automatically on each submission. When a problem has several submissions, the later ones are usually a more efficient rewrite.

Solved problems

Arrays & Hashing

Problem Approach Time Solution
Contains Duplicate Hash set of seen values O(n) Python
Valid Anagram Character frequency maps (earlier: sorting) O(n) Python
Two Sum Hash map of value → index O(n) Python
Top K Frequent Elements Counter + heap O(n log k) Python

Two Pointers

Problem Approach Time Solution
Valid Palindrome Two pointers skipping non-alphanumerics, O(1) space (earlier: filtered string reversal) O(n) Python
Two Sum II Two pointers on the sorted array O(n) Python

Linked List

Problem Approach Time Solution
Reverse Linked List Iterative pointer reversal O(n) Python
Merge Two Sorted Lists Dummy head + tail pointer O(n + m) Python
Linked List Cycle Floyd's slow/fast pointers O(n) Python
Remove Nth Node From End Dummy node + fast pointer with an n-step lead O(n) Python

About

Python solutions to NeetCode data structures & algorithms problems.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages