Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jack0pan/leetcode
LeetCode Problems' Solutions
https://github.com/jack0pan/leetcode
leetcode ruby
Last synced: 20 days ago
JSON representation
LeetCode Problems' Solutions
- Host: GitHub
- URL: https://github.com/jack0pan/leetcode
- Owner: jack0pan
- Created: 2018-02-23T02:39:29.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-10-21T04:24:10.000Z (over 6 years ago)
- Last Synced: 2024-11-22T07:42:57.777Z (3 months ago)
- Topics: leetcode, ruby
- Language: Ruby
- Homepage:
- Size: 113 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# LeetCode
## Algorithms| # | Title | Solution | Difficulty |
|---| ----- | -------- | ---------- |
|1|[Two Sum](https://leetcode.com/problems/two-sum/description/)|[README](./algorithms/two_sum)|Easy|
|2|[Add Two Numbers](https://leetcode.com/problems/add-two-numbers/description/)|[README](./algorithms/add_two_numbers)|Medium|
|3|[Longest Substring Without Repeating Characters](https://leetcode.com/problems/longest-substring-without-repeating-characters/description/)|[README](./algorithms/longest_substring_without_repeating_characters)|Medium|
|5|[Longest Palindromic Substring](https://leetcode.com/problems/longest-palindromic-substring/description/)|[README](./algorithms/longest_palindromic_substring)|Medium|
|6|[ZigZag Conversion](https://leetcode.com/problems/zigzag-conversion/description/)|[README](./algorithms/zigzag_conversion)|Medium|
|7|[Reverse Integer](https://leetcode.com/problems/reverse-integer/description/)|[README](./algorithms/reverse_integer)|Easy|
|8|[String to Integer (atoi)](https://leetcode.com/problems/string-to-integer-atoi/description/)|[README](./algorithms/string_to_integer_atoi)|Medium|
|9|[Palindrome Number](https://leetcode.com/problems/palindrome-number/description/)|[README](./algorithms/palindrome_number)|Easy|
|11|[Container With Most Water](https://leetcode.com/problems/container-with-most-water/description/)|[README](./algorithms/container_with_most_water)|Medium|
|12|[Integer to Roman](https://leetcode.com/problems/integer-to-roman/description/)|[README](./algorithms/integer_to_roman)|Medium|
|13|[Roman to Integer](https://leetcode.com/problems/roman-to-integer/description/)|[README](./algorithms/roman_to_integer)|Easy|
|14|[Longest Common Prefix](https://leetcode.com/problems/longest-common-prefix/description/)|[README](./algorithms/longest_common_prefix)|Easy|
|15|[3Sum](https://leetcode.com/problems/3sum/description/)|[README](./algorithms/three_sum)|Medium|
|16|[3Sum Closest](https://leetcode.com/problems/3sum-closest/description/)|[README](./algorithms/three_sum_closest)|Medium|
|17|[Letter Combinations of a Phone Number](https://leetcode.com/problems/letter-combinations-of-a-phone-number/description/)|[README](./algorithms/letter_combinations_of_a_phone_number)|Medium|
|18|[4Sum](https://leetcode.com/problems/4sum/description/)|[README](./algorithms/four_sum)|Medium|
|19|[Remove Nth Node From End of List](https://leetcode.com/problems/remove-nth-node-from-end-of-list/description/)|[README](./algorithms/remove_nth_from_end_of_list)|Medium|
|20|[Valid Parentheses](https://leetcode.com/problems/valid-parentheses/description/)|[README](./algorithms/valid_parentheses)|Easy|
|21|[Merge Two Sorted Lists](https://leetcode.com/problems/merge-two-sorted-lists/description/)|[README](./algorithms/merge_two_sorted_lists)|Easy|
|22|[Generate Parentheses](https://leetcode.com/problems/generate-parentheses/description/)|[README](./algorithms/generate_parentheses)|Medium|
|24|[Swap Nodes in Pairs](https://leetcode.com/problems/swap-nodes-in-pairs/description/)|[README](./algorithms/swap_nodes_in_pairs)|Medium|
|26|[Remove Duplicates from Sorted Array](https://leetcode.com/problems/remove-duplicates-from-sorted-array/description/)|[README](./algorithms/remove_duplicates_from_sorted_array)|Easy|
|27|[Remove Element](https://leetcode.com/problems/remove-element/description/)|[README](./algorithms/remove_element)|Easy|
|28|[Implement strStr()](https://leetcode.com/problems/impelement-strstr/description/)|[README](./algorithms/implement_strstr)|Easy|
|29|[Divide Two Integers](https://leetcode.com/problems/divide-tow-integers/description/)|[README](./algorithms/divide_two_integers)|Medium|
|31|[Next Permutation](https://leetcode.com/problems/next-permutation/description/)|[README](./algorithms/next_permutation)|Medium|
|33|[Search in Rotated Sorted Array](https://leetcode.com/problems/search-in-rotated-sorted-array/description/)|[README](./algorithms/search_in_rotated_sorted_array)|Medium|
|34|[Find First and Last Position of Element in Sorted Array](https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array/description/)|[README](./algorithms/find_first_and_last_position_of_element_in_sorted_array)|Medium|
|35|[Search Insert Postion](https://leetcode.com/problems/search-insert-position/description/)|[README](./algorithms/search_insert_position)|Easy|
|36|[Valid Sudoku](https://leetcode.com/problems/valid-sudoku/description/)|[README](./algorithms/valid_sudoku)|Medium|
|38|[Count and Say](https://leetcode.com/problems/count-and-say/description/)|[README](./algorithms/count_and_say)|Easy|
|39|[Combination Sum](https://leetcode.com/problems/combination-sum/description/)|[README](./algorithms/combination_sum)|Medium|
|40|[Combination Sum II](https://leetcode.com/problems/combination-sum-ii/description/)|[README](./algorithms/combination_sum_ii)|Medium|
|43|[Multiply Strings](https://leetcode.com/problems/multiply-strings/description/)|[README](./algorithms/multiply_strings)|Medium|
|46|[Permutations](https://leetcode.com/problems/permutations/description/)|[README](./algorithms/permutations)|Medium|
|47|[Permutations II](https://leetcode.com/problems/permutations-ii/description/)|[README](./algorithms/permutations_ii)|Medium|
|48|[Rotate Image](https://leetcode.com/problems/rotate-image/description/)|[README](./algorithms/rotate_image)|Medium|
|49|[Group Anagrams](https://leetcode.com/problems/group-anagrams/description/)|[README](./algorithms/group_anagrams)|Medium|
|50|[Pow(x, n)](https://leetcode.com/problems/powx-n/description/)|[README](./algorithms/powx_n)|Medium|
|53|[Maximum Subarray](https://leetcode.com/problems/maximum-subarray/description/)|[README](./algorithms/maximum_subarray)|Easy|
|54|[Spiral Matrix](https://leetcode.com/problems/spiral-matrix/description/)|[README](./algorithms/spiral_matrix)|Medium|
|55|[Jump Game](https://leetcode.com/problems/jump-game/description/)|[README](./algorithms/jump_game)|Medium|
|56|[Merge Intervals](https://leetcode.com/problems/merge-intervals/description/)|[README](./algorithms/merge_intervals)|Medium|
|58|[Length of Last Word](https://leetcode.com/problems/length-of-last-word/description/)|[README](./algorithms/length_of_last_word)|Easy|
|59|[Spiral Matrix II](https://leetcode.com/problems/spiral-matrix-ii/description/)|[README](./algorithms/spiral_matrix_ii)|Medium|
|60|[Permutation Sequence](https://leetcode.com/problems/permutation-sequence/description/)|[README](./algorithms/permutation_sequence)|Medium|
|61|[Rotate List](https://leetcode.com/problems/rotate-list/description/)|[README](./algorithms/rotate_list)|Medium|
|62|[Unique Paths](https://leetcode.com/problems/unique-paths/description/)|[README](./algorithms/unique_paths)|Medium|
|63|[Unique Paths II](https://leetcode.com/problems/unique-paths-ii/description/)|[README](./algorithms/unique_paths_ii)|Medium|
|64|[Minimum Path Sum](https://leetcode.com/problems/minimum-path-sum/description/)|[README](./algorithms/minimum_path_sum)|Medium|
|66|[Plus One](https://leetcode.com/problems/plus-one/description/)|[README](./algorithms/plus_one)|Easy|
|67|[Add Binary](https://leetcode.com/problems/add-binary/description/)|[README](./algorithms/add_binary)|Easy|
|69|[Sqrt(x)](https://leetcode.com/problems/sqrtx/description/)|[README](./algorithms/sqrtx)|Easy|
|70|[Climbing Stairs](https://leetcode.com/problems/climbing-stairs/description/)|[README](./algorithms/climbing_stairs)|Easy|
|71|[Simplify Path](https://leetcode.com/problems/simplify-path/description/)|[README](./algorithms/simplify_path)|Medium|
|73|[Set Matrix Zeroes](https://leetcode.com/problems/set-matrix-zeroes/description/)|[README](./algorithms/set_matrix_zeroes)|Medium|
|74|[Search a 2D Matrix](https://leetcode.com/problems/search-a-2d-matrix/description/)|[README](./algorithms/search_a_2d_matrix)|Medium|
|75|[Sort Colors](https://leetcode.com/problems/sort-colors/description/)|[README](./algorithms/sort_colors)|Medium|
|77|[Combinations](https://leetcode.com/problems/combinations/description/)|[README](./algorithms/combinations)|Medium|
|78|[Subsets](https://leetcode.com/problems/subsets/description/)|[README](./algorithms/subsets)|Medium|
|79|[Word Search](https://leetcode.com/problems/word-search/description/)|[README](./algorithms/word_search)|Medium|
|80|[Remove Duplicates from Sorted Array II](https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii/description/)|[README](./algorithms/remove_duplicates_from_sorted_array_ii)|Medium|
|81|[Search in Rotated Sorted Array II](https://leetcode.com/problems/search-in-rotated-sorted-array-ii/description/)|[README](./algorithms/search_in_rotated_sorted_array_ii)|Medium|
|82|[Remove Duplicates from Sorted List II](https://leetcode.com/problems/remove-duplicates-from-sorted-list-ii/description/)|[README](./algorithms/remove_duplicates_from_sorted_list_ii)|Medium|
|83|[Remove Duplicates from Sorted List](https://leetcode.com/problems/remove-duplicates-from-sorted-list/description/)|[README](./algorithms/remove_duplicates_from_sorted_list)|Easy|
|86|[Partition List](https://leetcode.com/problems/partition-list/description/)|[README](./algorithms/partition_list)|Medium|
|88|[Merge Sorted Array](https://leetcode.com/problems/merge-sorted-array/description/)|[README](./algorithms/merge_sorted_array)|Easy|
|89|[Gray Code](https://leetcode.com/problems/gray-code/description/)|[README](./algorithms/gray_code)|Medium|
|90|[Subsets II](https://leetcode.com/problems/subsets-ii/description/)|[README](./algorithms/subsets_ii)|Medium|
|91|[Decode Ways](https://leetcode.com/problems/decode-ways/description/)|[README](./algorithms/decode_ways)|Medium|
|92|[Reverse Linked List II](https://leetcode.com/problems/reverse-linked-list-ii/description/)|[README](./algorithms/reverse_linked_list_ii)|Medium|
|93|[Restore IP Addresses](https://leetcode.com/problems/restore-ip-addresses/description/)|[README](./algorithms/restore_ip_addresses)|Medium|
|94|[Binary Tree Inorder Traversal](https://leetcode.com/problems/binary-tree-inorder-traversal/description/)|[README](./algorithms/binary_tree_inorder_traversal)|Medium|
|96|[Unique Binary Search Trees](https://leetcode.com/problems/unique-binary-search-trees/description/)|[README](./algorithms/unique_binary_search_trees)|Medium|
|98|[Validate Binary Search Tree](https://leetcode.com/problems/validate-binary-search-tree/description/)|[README](./algorithms/validate_binary_search_tree)|Medium|
|100|[Same Tree](https://leetcode.com/problems/same-tree/description/)|[README](./algorithms/same_tree)|Easy|
|101|[Symmetric Tree](https://leetcode.com/problems/symmetric-tree/description/)|[README](./algorithms/symmetric_tree)|Easy|
|102|[Binary Tree Level Order Traversal](https://leetcode.com/problems/binary-tree-level-order-traversal/description/)|[README](./algorithms/binary_tree_level_order_traversal)|Medium|
|103|[Binary Tree Zigzag Level Order Traversal](https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal/description/)|[README](./algorithms/binary_tree_zigzag_level_order_traversal)|Medium|
|104|[Maximum Depth of Bianry Tree](https://leetcode.com/problems/maximum-depth-of-binary-tree/description/)|[README](./algorithms/maximum_depth_of_binary_tree)|Easy|
|105|[Construct Binary Tree from Preorder and Inorder Traversal](https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/description/)|[README](./algorithms/construct_binary_tree_from_preorder_and_inorder_traversal)|Medium|
|106|[Construct Binary Tree from Inorder and Postorder Traversal](https://leetcode.com/problems/construct-binary-tree-from-inorder-and-postorder-traversal/description/)|[README](./algorithms/construct_binary_tree_from_inorder_and_postorder_traversal)|Medium|
|107|[Binary Tree Level Order Traversal II](https://leetcode.com/problems/binary-tree-level-order-traversal-ii/description/)|[README](./algorithms/binary_tree_level_order_traversal_ii)|Medium|
|108|[Convert Sorted Array to Binary Search Tree](https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree/description/)|[README](./algorithms/convert_sorted_array_to_binary_search_tree)|Medium|
|109|[Convert Sorted List to Binary Search Tree](https://leetcode.com/problems/convert-sorted-list-to-binary-search-tree/description/)|[README](./algorithms/convert_sorted_list_to_binary_search_tree)|Medium|
|110|[Balanced Binary Tree](https://leetcode.com/problems/balanced-binary-tree/description/)|[README](./algorithms/balanced_binary_tree)|Easy|
|111|[Minimum Depth of Bianry Tree](https://leetcode.com/problems/minimum-depth-of-binary-tree/description/)|[README](./algorithms/minimum_depth_of_binary_tree)|Easy|
|144|[Binary Tree Preorder Traversal](https://leetcode.com/problems/binary-tree-preorder-traversal/description/)|[README](./algorithms/binary_tree_preorder_traversal)|Medium|
|145|[Binary Tree Postorder Traversal](https://leetcode.com/problems/binary-tree-postorder-traversal/description/)|[README](./algorithms/binary_tree_postorder_traversal)|Medium|
|206|[Reverse Linked List](https://leetcode.com/problems/reverse-linked-list/description/)|[README](./algorithms/reverse_linked_list)|Easy|