From a731b620cdbb5a60aa4bec6507ee6735fa82b10d Mon Sep 17 00:00:00 2001 From: Valentyn Kolesnikov Date: Sat, 2 Dec 2023 09:03:11 +0200 Subject: [PATCH] Updated readme --- README.md | 260 +++++++++++++++++++++++++++--------------------------- 1 file changed, 130 insertions(+), 130 deletions(-) diff --git a/README.md b/README.md index 08fa561..b67b80c 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,6 @@ [![](https://img.shields.io/github/forks/LeetCode-in-Ruby/LeetCode-in-Ruby?label=Fork%20me%20on%20GitHub%20&style=flat-square)](https://github.com/LeetCode-in-Ruby/LeetCode-in-Ruby/fork) > ["For coding interview preparation, LeetCode is one of the best online resource providing a rich library of more than 300 real coding interview questions for you to practice from using one of the 7 supported languages - C, C++, Java, Python, C#, JavaScript, Ruby."](https://www.quora.com/How-effective-is-Leetcode-for-preparing-for-technical-interviews) -* [Algorithm II](#algorithm-ii) * [Binary Search I](#binary-search-i) * [Binary Search II](#binary-search-ii) * [Dynamic Programming I](#dynamic-programming-i) @@ -16,135 +15,7 @@ * [Data Structure I](#data-structure-i) * [Data Structure II](#data-structure-ii) * [Algorithm I](#algorithm-i) - -### Algorithm II - -#### Day 1 Binary Search - -| | | | | | -|-|-|-|-|-|- -| 0034 |[Find First and Last Position of Element in Sorted Array](src/main/ruby/g0001_0100/s0034_find_first_and_last_position_of_element_in_sorted_array)| Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Binary_Search, Big_O_Time_O(log_n)_Space_O(1) | 60 | 77.52 -| 0033 |[Search in Rotated Sorted Array](src/main/ruby/g0001_0100/s0033_search_in_rotated_sorted_array)| Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Binary_Search, Big_O_Time_O(log_n)_Space_O(1) | 59 | 74.85 -| 0074 |[Search a 2D Matrix](src/main/ruby/g0001_0100/s0074_search_a_2d_matrix)| Medium | Top_100_Liked_Questions, Array, Binary_Search, Matrix, Big_O_Time_O(endRow+endCol)_Space_O(1) | 50 | 97.83 - -#### Day 2 Binary Search - -| | | | | | -|-|-|-|-|-|- -| 0153 |[Find Minimum in Rotated Sorted Array](src/main/ruby/g0101_0200/s0153_find_minimum_in_rotated_sorted_array)| Medium | Top_100_Liked_Questions, Array, Binary_Search, Big_O_Time_O(log_N)_Space_O(log_N) | 58 | 78.74 - -#### Day 3 Two Pointers - -| | | | | | -|-|-|-|-|-|- -| 0015 |[3Sum](src/main/ruby/g0001_0100/s0015_3sum)| Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Sorting, Two_Pointers, Big_O_Time_O(n\*log(n))_Space_O(n^2) | 659 | 83.74 - -#### Day 4 Two Pointers - -| | | | | | -|-|-|-|-|-|- -| 0011 |[Container With Most Water](src/main/ruby/g0001_0100/s0011_container_with_most_water)| Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Greedy, Two_Pointers, Big_O_Time_O(n)_Space_O(1) | 114 | 95.98 - -#### Day 5 Sliding Window - -| | | | | | -|-|-|-|-|-|- -| 0438 |[Find All Anagrams in a String](src/main/ruby/g0401_0500/s0438_find_all_anagrams_in_a_string)| Medium | Top_100_Liked_Questions, String, Hash_Table, Sliding_Window, Big_O_Time_O(n+m)_Space_O(1) | 186 | 82.72 - -#### Day 6 Breadth First Search Depth First Search - -| | | | | | -|-|-|-|-|-|- -| 0200 |[Number of Islands](src/main/ruby/g0101_0200/s0200_number_of_islands)| Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Depth_First_Search, Breadth_First_Search, Matrix, Union_Find, Big_O_Time_O(M\*N)_Space_O(M\*N) | 141 | 72.68 - -#### Day 7 Breadth First Search Depth First Search - -| | | | | | -|-|-|-|-|-|- - -#### Day 8 Breadth First Search Depth First Search - -| | | | | | -|-|-|-|-|-|- - -#### Day 9 Recursion Backtracking - -| | | | | | -|-|-|-|-|-|- -| 0078 |[Subsets](src/main/ruby/g0001_0100/s0078_subsets)| Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Bit_Manipulation, Backtracking, Big_O_Time_O(2^n)_Space_O(n\*2^n) | 63 | 70.43 - -#### Day 10 Recursion Backtracking - -| | | | | | -|-|-|-|-|-|- -| 0039 |[Combination Sum](src/main/ruby/g0001_0100/s0039_combination_sum)| Medium | Top_100_Liked_Questions, Array, Backtracking, Big_O_Time_O(2^n)_Space_O(n+2^n) | 79 | 74.84 - -#### Day 11 Recursion Backtracking - -| | | | | | -|-|-|-|-|-|- -| 0017 |[Letter Combinations of a Phone Number](src/main/ruby/g0001_0100/s0017_letter_combinations_of_a_phone_number)| Medium | Top_100_Liked_Questions, Top_Interview_Questions, String, Hash_Table, Backtracking, Big_O_Time_O(4^n)_Space_O(n) | 49 | 93.94 -| 0022 |[Generate Parentheses](src/main/ruby/g0001_0100/s0022_generate_parentheses)| Medium | Top_100_Liked_Questions, Top_Interview_Questions, String, Dynamic_Programming, Backtracking, Big_O_Time_O(2^n)_Space_O(n) | 43 | 100.00 -| 0079 |[Word Search](src/main/ruby/g0001_0100/s0079_word_search)| Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Matrix, Backtracking, Big_O_Time_O(4^(m\*n))_Space_O(m\*n) | 56 | 100.00 - -#### Day 12 Dynamic Programming - -| | | | | | -|-|-|-|-|-|- -| 0055 |[Jump Game](src/main/ruby/g0001_0100/s0055_jump_game)| Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Dynamic_Programming, Greedy, Big_O_Time_O(n)_Space_O(1) | 88 | 95.88 - -#### Day 13 Dynamic Programming - -| | | | | | -|-|-|-|-|-|- -| 0045 |[Jump Game II](src/main/ruby/g0001_0100/s0045_jump_game_ii)| Medium | Top_100_Liked_Questions, Array, Dynamic_Programming, Greedy, Big_O_Time_O(n)_Space_O(1) | 68 | 75.23 -| 0062 |[Unique Paths](src/main/ruby/g0001_0100/s0062_unique_paths)| Medium | Top_100_Liked_Questions, Top_Interview_Questions, Dynamic_Programming, Math, Combinatorics, Big_O_Time_O(m\*n)_Space_O(m\*n) | 50 | 91.92 - -#### Day 14 Dynamic Programming - -| | | | | | -|-|-|-|-|-|- -| 0005 |[Longest Palindromic Substring](src/main/ruby/g0001_0100/s0005_longest_palindromic_substring)| Medium | Top_100_Liked_Questions, Top_Interview_Questions, String, Dynamic_Programming, Big_O_Time_O(n)_Space_O(n) | 117 | 98.63 - -#### Day 15 Dynamic Programming - -| | | | | | -|-|-|-|-|-|- -| 0139 |[Word Break](src/main/ruby/g0101_0200/s0139_word_break)| Medium | Top_100_Liked_Questions, Top_Interview_Questions, String, Hash_Table, Dynamic_Programming, Trie, Memoization, Big_O_Time_O(M+max\*N)_Space_O(M+N+max) | 64 | 79.31 - -#### Day 16 Dynamic Programming - -| | | | | | -|-|-|-|-|-|- -| 0300 |[Longest Increasing Subsequence](src/main/ruby/g0201_0300/s0300_longest_increasing_subsequence)| Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Dynamic_Programming, Binary_Search, Big_O_Time_O(n\*log_n)_Space_O(n) | 68 | 96.55 - -#### Day 17 Dynamic Programming - -| | | | | | -|-|-|-|-|-|- -| 1143 |[Longest Common Subsequence](src/main/ruby/g1101_1200/s1143_longest_common_subsequence)| Medium | Top_100_Liked_Questions, String, Dynamic_Programming, Big_O_Time_O(n\*m)_Space_O(n\*m) | 828 | 75.00 - -#### Day 18 Dynamic Programming - -| | | | | | -|-|-|-|-|-|- -| 0072 |[Edit Distance](src/main/ruby/g0001_0100/s0072_edit_distance)| Hard | Top_100_Liked_Questions, String, Dynamic_Programming, Big_O_Time_O(n^2)_Space_O(n2) | 139 | 73.91 -| 0322 |[Coin Change](src/main/ruby/g0301_0400/s0322_coin_change)| Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Dynamic_Programming, Breadth_First_Search, Big_O_Time_O(m\*n)_Space_O(amount) | 655 | 84.96 - -#### Day 19 Bit Manipulation - -| | | | | | -|-|-|-|-|-|- - -#### Day 20 Others - -| | | | | | -|-|-|-|-|-|- - -#### Day 21 Others - -| | | | | | -|-|-|-|-|-|- +* [Algorithm II](#algorithm-ii) ### Binary Search I @@ -1398,6 +1269,135 @@ |-|-|-|-|-|- | 0136 |[Single Number](src/main/ruby/g0101_0200/s0136_single_number)| Easy | Top_100_Liked_Questions, Top_Interview_Questions, Array, Bit_Manipulation, Big_O_Time_O(N)_Space_O(1) | 68 | 78.44 +### Algorithm II + +#### Day 1 Binary Search + +| | | | | | +|-|-|-|-|-|- +| 0034 |[Find First and Last Position of Element in Sorted Array](src/main/ruby/g0001_0100/s0034_find_first_and_last_position_of_element_in_sorted_array)| Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Binary_Search, Big_O_Time_O(log_n)_Space_O(1) | 60 | 77.52 +| 0033 |[Search in Rotated Sorted Array](src/main/ruby/g0001_0100/s0033_search_in_rotated_sorted_array)| Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Binary_Search, Big_O_Time_O(log_n)_Space_O(1) | 59 | 74.85 +| 0074 |[Search a 2D Matrix](src/main/ruby/g0001_0100/s0074_search_a_2d_matrix)| Medium | Top_100_Liked_Questions, Array, Binary_Search, Matrix, Big_O_Time_O(endRow+endCol)_Space_O(1) | 50 | 97.83 + +#### Day 2 Binary Search + +| | | | | | +|-|-|-|-|-|- +| 0153 |[Find Minimum in Rotated Sorted Array](src/main/ruby/g0101_0200/s0153_find_minimum_in_rotated_sorted_array)| Medium | Top_100_Liked_Questions, Array, Binary_Search, Big_O_Time_O(log_N)_Space_O(log_N) | 58 | 78.74 + +#### Day 3 Two Pointers + +| | | | | | +|-|-|-|-|-|- +| 0015 |[3Sum](src/main/ruby/g0001_0100/s0015_3sum)| Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Sorting, Two_Pointers, Big_O_Time_O(n\*log(n))_Space_O(n^2) | 659 | 83.74 + +#### Day 4 Two Pointers + +| | | | | | +|-|-|-|-|-|- +| 0011 |[Container With Most Water](src/main/ruby/g0001_0100/s0011_container_with_most_water)| Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Greedy, Two_Pointers, Big_O_Time_O(n)_Space_O(1) | 114 | 95.98 + +#### Day 5 Sliding Window + +| | | | | | +|-|-|-|-|-|- +| 0438 |[Find All Anagrams in a String](src/main/ruby/g0401_0500/s0438_find_all_anagrams_in_a_string)| Medium | Top_100_Liked_Questions, String, Hash_Table, Sliding_Window, Big_O_Time_O(n+m)_Space_O(1) | 186 | 82.72 + +#### Day 6 Breadth First Search Depth First Search + +| | | | | | +|-|-|-|-|-|- +| 0200 |[Number of Islands](src/main/ruby/g0101_0200/s0200_number_of_islands)| Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Depth_First_Search, Breadth_First_Search, Matrix, Union_Find, Big_O_Time_O(M\*N)_Space_O(M\*N) | 141 | 72.68 + +#### Day 7 Breadth First Search Depth First Search + +| | | | | | +|-|-|-|-|-|- + +#### Day 8 Breadth First Search Depth First Search + +| | | | | | +|-|-|-|-|-|- + +#### Day 9 Recursion Backtracking + +| | | | | | +|-|-|-|-|-|- +| 0078 |[Subsets](src/main/ruby/g0001_0100/s0078_subsets)| Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Bit_Manipulation, Backtracking, Big_O_Time_O(2^n)_Space_O(n\*2^n) | 63 | 70.43 + +#### Day 10 Recursion Backtracking + +| | | | | | +|-|-|-|-|-|- +| 0039 |[Combination Sum](src/main/ruby/g0001_0100/s0039_combination_sum)| Medium | Top_100_Liked_Questions, Array, Backtracking, Big_O_Time_O(2^n)_Space_O(n+2^n) | 79 | 74.84 + +#### Day 11 Recursion Backtracking + +| | | | | | +|-|-|-|-|-|- +| 0017 |[Letter Combinations of a Phone Number](src/main/ruby/g0001_0100/s0017_letter_combinations_of_a_phone_number)| Medium | Top_100_Liked_Questions, Top_Interview_Questions, String, Hash_Table, Backtracking, Big_O_Time_O(4^n)_Space_O(n) | 49 | 93.94 +| 0022 |[Generate Parentheses](src/main/ruby/g0001_0100/s0022_generate_parentheses)| Medium | Top_100_Liked_Questions, Top_Interview_Questions, String, Dynamic_Programming, Backtracking, Big_O_Time_O(2^n)_Space_O(n) | 43 | 100.00 +| 0079 |[Word Search](src/main/ruby/g0001_0100/s0079_word_search)| Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Matrix, Backtracking, Big_O_Time_O(4^(m\*n))_Space_O(m\*n) | 56 | 100.00 + +#### Day 12 Dynamic Programming + +| | | | | | +|-|-|-|-|-|- +| 0055 |[Jump Game](src/main/ruby/g0001_0100/s0055_jump_game)| Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Dynamic_Programming, Greedy, Big_O_Time_O(n)_Space_O(1) | 88 | 95.88 + +#### Day 13 Dynamic Programming + +| | | | | | +|-|-|-|-|-|- +| 0045 |[Jump Game II](src/main/ruby/g0001_0100/s0045_jump_game_ii)| Medium | Top_100_Liked_Questions, Array, Dynamic_Programming, Greedy, Big_O_Time_O(n)_Space_O(1) | 68 | 75.23 +| 0062 |[Unique Paths](src/main/ruby/g0001_0100/s0062_unique_paths)| Medium | Top_100_Liked_Questions, Top_Interview_Questions, Dynamic_Programming, Math, Combinatorics, Big_O_Time_O(m\*n)_Space_O(m\*n) | 50 | 91.92 + +#### Day 14 Dynamic Programming + +| | | | | | +|-|-|-|-|-|- +| 0005 |[Longest Palindromic Substring](src/main/ruby/g0001_0100/s0005_longest_palindromic_substring)| Medium | Top_100_Liked_Questions, Top_Interview_Questions, String, Dynamic_Programming, Big_O_Time_O(n)_Space_O(n) | 117 | 98.63 + +#### Day 15 Dynamic Programming + +| | | | | | +|-|-|-|-|-|- +| 0139 |[Word Break](src/main/ruby/g0101_0200/s0139_word_break)| Medium | Top_100_Liked_Questions, Top_Interview_Questions, String, Hash_Table, Dynamic_Programming, Trie, Memoization, Big_O_Time_O(M+max\*N)_Space_O(M+N+max) | 64 | 79.31 + +#### Day 16 Dynamic Programming + +| | | | | | +|-|-|-|-|-|- +| 0300 |[Longest Increasing Subsequence](src/main/ruby/g0201_0300/s0300_longest_increasing_subsequence)| Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Dynamic_Programming, Binary_Search, Big_O_Time_O(n\*log_n)_Space_O(n) | 68 | 96.55 + +#### Day 17 Dynamic Programming + +| | | | | | +|-|-|-|-|-|- +| 1143 |[Longest Common Subsequence](src/main/ruby/g1101_1200/s1143_longest_common_subsequence)| Medium | Top_100_Liked_Questions, String, Dynamic_Programming, Big_O_Time_O(n\*m)_Space_O(n\*m) | 828 | 75.00 + +#### Day 18 Dynamic Programming + +| | | | | | +|-|-|-|-|-|- +| 0072 |[Edit Distance](src/main/ruby/g0001_0100/s0072_edit_distance)| Hard | Top_100_Liked_Questions, String, Dynamic_Programming, Big_O_Time_O(n^2)_Space_O(n2) | 139 | 73.91 +| 0322 |[Coin Change](src/main/ruby/g0301_0400/s0322_coin_change)| Medium | Top_100_Liked_Questions, Top_Interview_Questions, Array, Dynamic_Programming, Breadth_First_Search, Big_O_Time_O(m\*n)_Space_O(amount) | 655 | 84.96 + +#### Day 19 Bit Manipulation + +| | | | | | +|-|-|-|-|-|- + +#### Day 20 Others + +| | | | | | +|-|-|-|-|-|- + +#### Day 21 Others + +| | | | | | +|-|-|-|-|-|- + ## Algorithms | # | Title | Difficulty | Tag | Time, ms | Time, %