An open API service indexing awesome lists of open source software.

https://github.com/mbtakanov/leet-code

LeetCode solutions in Python organized by algorithmic patterns. Each solution includes problem description, and time/space complexity analysis.
https://github.com/mbtakanov/leet-code

algorithms data-structures interview-preparation leetcode programming-challenges python

Last synced: about 15 hours ago
JSON representation

LeetCode solutions in Python organized by algorithmic patterns. Each solution includes problem description, and time/space complexity analysis.

Awesome Lists containing this project

README

          

LeetCode
========
| # | Title | Solution | Algorithm | Difficulty |
|---| ----- | -------- | --------- | ---------- |
|0001|[Two Sum](https://leetcode.com/problems/two-sum)|[Python](./algorithms/hashmap/0001_two_sum.py)|Hashmap|![](https://img.shields.io/badge/Easy-green)|
|0002|[Add Two Numbers](https://leetcode.com/problems/add-two-numbers)|[Python](./algorithms/linked_list/0002_add_two_numbers.py)|Linked List|![](https://img.shields.io/badge/Medium-orange)|
|0003|[Longest Substring Without Repeating Characters](https://leetcode.com/problems/longest-substring-without-repeating-characters)|[Python](./algorithms/sliding_window/0003_longest_substring_without_repeating_characters.py)|Sliding Window|![](https://img.shields.io/badge/Medium-orange)|
|0011|[Container With Most Water](https://leetcode.com/problems/container-with-most-water)|[Python](./algorithms/two_pointers/0011_container_with_most_water.py)|Two Pointers|![](https://img.shields.io/badge/Easy-green)|
|0012|[Integer to Roman](https://leetcode.com/problems/integer-to-roman)|[Python](./algorithms/array_string/0012_integer_to_roman.py)|Array & String|![](https://img.shields.io/badge/Medium-orange)|
|0013|[Roman to Integer](https://leetcode.com/problems/roman-to-integer)|[Python](./algorithms/array_string/0013_roman_to_integer.py)|Array & String|![](https://img.shields.io/badge/Easy-green)|
|0014|[Longest Common Prefix](https://leetcode.com/problems/longest-common-prefix)|[Python](./algorithms/array_string/0014_longest_common_prefix.py)|Array & String|![](https://img.shields.io/badge/Easy-green)|
|0015|[3Sum](https://leetcode.com/problems/3sum)|[Python](./algorithms/two_pointers/0015_3sum.py)|Two Pointers|![](https://img.shields.io/badge/Medium-orange)|
|0020|[Valid Parentheses](https://leetcode.com/problems/valid-parentheses)|[Python](./algorithms/stack/0020_valid_parentheses.py)|Stack|![](https://img.shields.io/badge/Easy-green)|
|0021|[Merge Two Sorted Lists](https://leetcode.com/problems/merge-two-sorted-lists)|[Python](./algorithms/linked_list/0021_merge_two_sorted_lists.py)|Linked List|![](https://img.shields.io/badge/Easy-green)|
|0026|[Remove Duplicates from Sorted Array](https://leetcode.com/problems/remove-duplicates-from-sorted-array)|[Python](./algorithms/array_string/0026_remove_duplicates_from_sorted_array.py)|Array & String|![](https://img.shields.io/badge/Easy-green)|
|0027|[Remove Element](https://leetcode.com/problems/remove-element)|[Python](./algorithms/array_string/0027_remove_element.py)|Array & String|![](https://img.shields.io/badge/Easy-green)|
|0028|[Find the Index of the First Occurrence in a String](https://leetcode.com/problems/find-the-index-of-the-first-occurrence-in-a-string)|[Python](./algorithms/array_string/0028_find_the_index_of_the_first_occurrence_in_a_string.py)|Array & String|![](https://img.shields.io/badge/Easy-green)|
|0045|[Jump Game II](https://leetcode.com/problems/jump-game-ii)|[Python](./algorithms/array_string/0045_jump_game_ii.py)|Array & String|![](https://img.shields.io/badge/Medium-orange)|
|0049|[Group Anagrams](https://leetcode.com/problems/group-anagrams)|[Python](./algorithms/hashmap/0049_group_anagrams.py)|Hashmap|![](https://img.shields.io/badge/Medium-orange)|
|0055|[Jump Game](https://leetcode.com/problems/jump-game)|[Python](./algorithms/array_string/0055_jump_game.py)|Array & String|![](https://img.shields.io/badge/Medium-orange)|
|0056|[Merge Intervals](https://leetcode.com/problems/merge-intervals)|[Python](./algorithms/intervals/0056_merge_intervals.py)|Intervals|![](https://img.shields.io/badge/Medium-orange)|
|0057|[Insert Interval](https://leetcode.com/problems/insert-interval)|[Python](./algorithms/intervals/0057_insert_interval.py)|Intervals|![](https://img.shields.io/badge/Medium-orange)|
|0058|[Length of Last Word](https://leetcode.com/problems/length-of-last-word)|[Python](./algorithms/array_string/0058_length_of_last_word.py)|Array & String|![](https://img.shields.io/badge/Easy-green)|
|0080|[Remove Duplicates from Sorted Array II](https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii)|[Python](./algorithms/array_string/0080_remove_duplicates_from_sorted_array_ii.py)|Array & String|![](https://img.shields.io/badge/Medium-orange)|
|0088|[Merge Sorted Array](https://leetcode.com/problems/merge-sorted-array)|[Python](./algorithms/array_string/0088_merge_sorted_array.py)|Array & String|![](https://img.shields.io/badge/Easy-green)|
|0092|[Reverse Linked List II](https://leetcode.com/problems/reverse-linked-list-ii)|[Python](./algorithms/linked_list/0092_reverse_linked_list_ii.py)|Linked List|![](https://img.shields.io/badge/Medium-orange)|
|0121|[Best Time to Buy and Sell Stock](https://leetcode.com/problems/best-time-to-buy-and-sell-stock)|[Python](./algorithms/array_string/0121_best_time_to_buy_and_sell_stock.py)|Array & String|![](https://img.shields.io/badge/Easy-green)|
|0122|[Best Time to Buy and Sell Stock II](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii)|[Python](./algorithms/array_string/0122_best_time_to_buy_and_sell_stock_ii.py)|Array & String|![](https://img.shields.io/badge/Medium-orange)|
|0125|[Valid Palindrome](https://leetcode.com/problems/valid-palindrome)|[Python](./algorithms/two_pointers/0125_valid_palindrome.py)|Two Pointers|![](https://img.shields.io/badge/Easy-green)|
|0128|[Longest Consecutive Sequence](https://leetcode.com/problems/longest-consecutive-sequence)|[Python](./algorithms/hashmap/0128_longest_consecutive_sequence.py)|Hashmap|![](https://img.shields.io/badge/Medium-orange)|
|0141|[Linked List Cycle](https://leetcode.com/problems/linked-list-cycle)|[Python](./algorithms/linked_list/0141_linked_list_cycle.py)|Linked List|![](https://img.shields.io/badge/Easy-green)|
|0146|[LRU Cache](https://leetcode.com/problems/lru-cache)|[Python](./algorithms/linked_list/0146_lru_cache.py)|Linked List|![](https://img.shields.io/badge/Medium-orange)|
|0151|[Reverse Words in a String](https://leetcode.com/problems/reverse-words-in-a-string)|[Python](./algorithms/array_string/0151_reverse_words_in_a_string.py)|Array & String|![](https://img.shields.io/badge/Medium-orange)|
|0167|[Two Sum II - Input array is sorted](https://leetcode.com/problems/two-sum-ii-input-array-is-sorted)|[Python](./algorithms/two_pointers/0167_two_sum_ii_input_array_is_sorted.py)|Two Pointers|![](https://img.shields.io/badge/Medium-orange)|
|0169|[Majority Element](https://leetcode.com/problems/majority-element)|[Python](./algorithms/array_string/0169_majority_element.py)|Array & String|![](https://img.shields.io/badge/Easy-green)|
|0202|[Happy Number](https://leetcode.com/problems/happy-number)|[Python](./algorithms/hashmap/0202_happy_number.py)|Hashmap|![](https://img.shields.io/badge/Easy-green)|
|0205|[Isomorphic Strings](https://leetcode.com/problems/isomorphic-strings)|[Python](./algorithms/hashmap/0205_isomorphic_strings.py)|Hashmap|![](https://img.shields.io/badge/Easy-green)|
|0209|[Minimum Size Subarray Sum](https://leetcode.com/problems/minimum-size-subarray-sum)|[Python](./algorithms/sliding_window/0209_minimum_size_subarray_sum.py)|Sliding Window|![](https://img.shields.io/badge/Medium-orange)|
|0219|[Contains Duplicate II](https://leetcode.com/problems/contains-duplicate-ii)|[Python](./algorithms/hashmap/0219_contains_duplicate_ii.py)|Hashmap|![](https://img.shields.io/badge/Easy-green)|
|0228|[Summary Ranges](https://leetcode.com/problems/summary-ranges)|[Python](./algorithms/intervals/0228_summary_ranges.py)|Intervals|![](https://img.shields.io/badge/Easy-green)|
|0242|[Valid Anagram](https://leetcode.com/problems/valid-anagram)|[Python](./algorithms/hashmap/0242_valid_anagram.py)|Hashmap|![](https://img.shields.io/badge/Easy-green)|
|0274|[H-Index](https://leetcode.com/problems/h-index)|[Python](./algorithms/array_string/0274_h_index.py)|Array & String|![](https://img.shields.io/badge/Medium-orange)|
|0290|[Word Pattern](https://leetcode.com/problems/word-pattern)|[Python](./algorithms/hashmap/0290_word_pattern.py)|Hashmap|![](https://img.shields.io/badge/Easy-green)|
|0380|[Insert Delete GetRandom O(1)](https://leetcode.com/problems/insert-delete-getrandom-o1)|[Python](./algorithms/array_string/0380_insert_delete_get_random_o(1).py)|Array & String|![](https://img.shields.io/badge/Medium-orange)|
|0383|[Ransom Note](https://leetcode.com/problems/ransom-note)|[Python](./algorithms/hashmap/0383_ransom_note.py)|Hashmap|![](https://img.shields.io/badge/Easy-green)|
|0392|[Is Subsequence](https://leetcode.com/problems/is-subsequence)|[Python](./algorithms/two_pointers/0392_is_subsequence.py)|Two Pointers|![](https://img.shields.io/badge/Easy-green)|