Skip to content

Commit

Permalink
Improved erlang
Browse files Browse the repository at this point in the history
  • Loading branch information
javadev committed Feb 8, 2025
1 parent 7e9dc3d commit 0233451
Show file tree
Hide file tree
Showing 56 changed files with 102 additions and 76 deletions.
7 changes: 4 additions & 3 deletions src/main/erlang/g0001_0100/s0001_two_sum/Solution.erl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
% #Easy #Top_100_Liked_Questions #Top_Interview_Questions #Array #Hash_Table
% #Data_Structure_I_Day_2_Array #Level_1_Day_13_Hashmap #Udemy_Arrays #Big_O_Time_O(n)_Space_O(n)
% #AI_can_be_used_to_solve_the_task #2025_01_05_Time_3_(97.50%)_Space_65.32_(7.50%)
% #Easy #Top_100_Liked_Questions #Top_Interview_Questions #Array #Hash_Table
% #Data_Structure_I_Day_2_Array #Level_1_Day_13_Hashmap #Udemy_Arrays #Top_Interview_150_Hashmap
% #Big_O_Time_O(n)_Space_O(n) #AI_can_be_used_to_solve_the_task
% #2025_01_05_Time_3_(97.50%)_Space_65.32_(7.50%)

-spec two_sum(Nums :: [integer()], Target :: integer()) -> [integer()].
two_sum(Nums, Target) ->
Expand Down
4 changes: 2 additions & 2 deletions src/main/erlang/g0001_0100/s0002_add_two_numbers/Solution.erl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
% #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Math #Linked_List #Recursion
% #Data_Structure_II_Day_10_Linked_List #Programming_Skills_II_Day_15
% #Big_O_Time_O(max(N,M))_Space_O(max(N,M)) #AI_can_be_used_to_solve_the_task
% #2025_01_05_Time_1_(77.78%)_Space_63.11_(100.00%)
% #Top_Interview_150_Linked_List #Big_O_Time_O(max(N,M))_Space_O(max(N,M))
% #AI_can_be_used_to_solve_the_task #2025_01_05_Time_1_(77.78%)_Space_63.11_(100.00%)

%% Definition for singly-linked list.
%%
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
% #Medium #Top_100_Liked_Questions #Top_Interview_Questions #String #Hash_Table #Sliding_Window
% #Algorithm_I_Day_6_Sliding_Window #Level_2_Day_14_Sliding_Window/Two_Pointer #Udemy_Strings
% #Big_O_Time_O(n)_Space_O(1) #AI_can_be_used_to_solve_the_task
% #Top_Interview_150_Sliding_Window #Big_O_Time_O(n)_Space_O(1) #AI_can_be_used_to_solve_the_task
% #2025_01_08_Time_11_(100.00%)_Space_61.60_(60.00%)

-spec length_of_longest_substring(S :: unicode:unicode_binary()) -> integer().
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
% #Hard #Top_100_Liked_Questions #Top_Interview_Questions #Array #Binary_Search #Divide_and_Conquer
% #Big_O_Time_O(log(min(N,M)))_Space_O(1) #AI_can_be_used_to_solve_the_task
% #2025_01_08_Time_1_(100.00%)_Space_65.96_(100.00%)
% #Top_Interview_150_Binary_Search #Big_O_Time_O(log(min(N,M)))_Space_O(1)
% #AI_can_be_used_to_solve_the_task #2025_01_08_Time_1_(100.00%)_Space_65.96_(100.00%)

-spec find_median_sorted_arrays(Nums1 :: [integer()], Nums2 :: [integer()]) -> float().
find_median_sorted_arrays(Nums1, Nums2) ->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
% #Medium #Top_100_Liked_Questions #Top_Interview_Questions #String #Dynamic_Programming
% #Data_Structure_II_Day_9_String #Algorithm_II_Day_14_Dynamic_Programming
% #Dynamic_Programming_I_Day_17 #Udemy_Strings #Big_O_Time_O(n)_Space_O(n)
% #2025_01_08_Time_179_(100.00%)_Space_59.84_(100.00%)
% #Dynamic_Programming_I_Day_17 #Udemy_Strings #Top_Interview_150_Multidimensional_DP
% #Big_O_Time_O(n)_Space_O(n) #2025_01_08_Time_179_(100.00%)_Space_59.84_(100.00%)

-spec longest_palindrome(S :: unicode:unicode_binary()) -> unicode:unicode_binary().
longest_palindrome(S) ->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
% #Medium #String #2025_01_08_Time_203_(100.00%)_Space_60.52_(100.00%)
% #Medium #String #Top_Interview_150_Array/String
% #2025_01_08_Time_203_(100.00%)_Space_60.52_(100.00%)

%% Define the function specification
-spec convert(S :: unicode:unicode_binary(), NumRows :: integer()) -> unicode:unicode_binary().
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
% #Easy #Math #Udemy_Integers #2025_01_09_Time_1_(100.00%)_Space_58.73_(70.00%)
% #Easy #Math #Udemy_Integers #Top_Interview_150_Math
% #2025_01_09_Time_1_(100.00%)_Space_58.73_(70.00%)

-spec is_palindrome(X :: integer()) -> boolean().
is_palindrome(X) when X < 0 ->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
% #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Array #Greedy #Two_Pointers
% #Algorithm_II_Day_4_Two_Pointers #Big_O_Time_O(n)_Space_O(1)
% #Algorithm_II_Day_4_Two_Pointers #Top_Interview_150_Two_Pointers #Big_O_Time_O(n)_Space_O(1)
% #2025_01_09_Time_13_(100.00%)_Space_123.05_(100.00%)

-spec max_area([integer()]) -> integer().
Expand Down
3 changes: 2 additions & 1 deletion src/main/erlang/g0001_0100/s0015_3sum/Solution.erl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
% #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Array #Sorting #Two_Pointers
% #Data_Structure_II_Day_1_Array #Algorithm_II_Day_3_Two_Pointers #Udemy_Two_Pointers
% #Big_O_Time_O(n*log(n))_Space_O(n^2) #2025_01_09_Time_1387_(100.00%)_Space_527.05_(_%)
% #Top_Interview_150_Two_Pointers #Big_O_Time_O(n*log(n))_Space_O(n^2)
% #2025_01_09_Time_1387_(100.00%)_Space_527.05_(_%)

-spec three_sum(Nums :: [integer()]) -> [[integer()]].

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
% #Medium #Top_100_Liked_Questions #Top_Interview_Questions #String #Hash_Table #Backtracking
% #Algorithm_II_Day_11_Recursion_Backtracking #Udemy_Backtracking/Recursion
% #Big_O_Time_O(4^n)_Space_O(n) #2025_01_12_Time_0_(100.00%)_Space_58.43_(_%)
% #Top_Interview_150_Backtracking #Big_O_Time_O(4^n)_Space_O(n)
% #2025_01_12_Time_0_(100.00%)_Space_58.43_(_%)

-spec letter_combinations(Digits :: unicode:unicode_binary()) -> [unicode:unicode_binary()].
letter_combinations(Digits) ->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
% #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Two_Pointers #Linked_List
% #Algorithm_I_Day_5_Two_Pointers #Level_2_Day_3_Linked_List #Big_O_Time_O(L)_Space_O(L)
% #2025_01_11_Time_0_(100.00%)_Space_62.72_(100.00%)
% #Algorithm_I_Day_5_Two_Pointers #Level_2_Day_3_Linked_List #Top_Interview_150_Linked_List
% #Big_O_Time_O(L)_Space_O(L) #2025_01_11_Time_0_(100.00%)_Space_62.72_(100.00%)

%% Definition for singly-linked list.
%%
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
% #Easy #Top_100_Liked_Questions #Top_Interview_Questions #String #Stack
% #Data_Structure_I_Day_9_Stack_Queue #Udemy_Strings #Big_O_Time_O(n)_Space_O(n)
% #2025_01_11_Time_0_(100.00%)_Space_60.53_(_%)
% #Data_Structure_I_Day_9_Stack_Queue #Udemy_Strings #Top_Interview_150_Stack
% #Big_O_Time_O(n)_Space_O(n) #2025_01_11_Time_0_(100.00%)_Space_60.53_(_%)

%% Check if binary has valid parentheses
-spec is_valid(S :: unicode:unicode_binary()) -> boolean().
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
% #Easy #Top_100_Liked_Questions #Top_Interview_Questions #Linked_List #Recursion
% #Data_Structure_I_Day_7_Linked_List #Algorithm_I_Day_10_Recursion_Backtracking
% #Level_1_Day_3_Linked_List #Udemy_Linked_List #Big_O_Time_O(m+n)_Space_O(m+n)
% #2025_01_11_Time_0_(100.00%)_Space_62.80_(66.67%)
% #Level_1_Day_3_Linked_List #Udemy_Linked_List #Top_Interview_150_Linked_List
% #Big_O_Time_O(m+n)_Space_O(m+n) #2025_01_11_Time_0_(100.00%)_Space_62.80_(66.67%)

%% Definition for singly-linked list.
%%
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
% #Medium #Top_100_Liked_Questions #Top_Interview_Questions #String #Dynamic_Programming
% #Backtracking #Algorithm_II_Day_11_Recursion_Backtracking #Udemy_Backtracking/Recursion
% #Big_O_Time_O(2^n)_Space_O(n) #2025_01_11_Time_0_(100.00%)_Space_58.84_(100.00%)
% #Top_Interview_150_Backtracking #Big_O_Time_O(2^n)_Space_O(n)
% #2025_01_11_Time_0_(100.00%)_Space_58.84_(100.00%)

%% Generate all valid parenthesis combinations
-spec generate_parenthesis(N :: integer()) -> [unicode:unicode_binary()].
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
% #Hard #Top_100_Liked_Questions #Top_Interview_Questions #Heap_Priority_Queue #Linked_List
% #Divide_and_Conquer #Merge_Sort #Big_O_Time_O(k*n*log(k))_Space_O(log(k))
% #2025_01_11_Time_93_(100.00%)_Space_71.11_(100.00%)
% #Divide_and_Conquer #Merge_Sort #Top_Interview_150_Divide_and_Conquer
% #Big_O_Time_O(k*n*log(k))_Space_O(log(k)) #2025_01_11_Time_93_(100.00%)_Space_71.11_(100.00%)

%% Definition for singly-linked list.
%%
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
% #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Array #Binary_Search
% #Algorithm_II_Day_1_Binary_Search #Binary_Search_I_Day_11 #Level_2_Day_8_Binary_Search
% #Udemy_Binary_Search #Big_O_Time_O(log_n)_Space_O(1)
% #Udemy_Binary_Search #Top_Interview_150_Binary_Search #Big_O_Time_O(log_n)_Space_O(1)
% #2025_01_12_Time_0_(100.00%)_Space_61.27_(100.00%)

-spec search(Nums :: [integer()], Target :: integer()) -> integer().
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
% #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Array #Binary_Search
% #Algorithm_II_Day_1_Binary_Search #Binary_Search_I_Day_5 #Big_O_Time_O(log_n)_Space_O(1)
% #2025_01_12_Time_1_(100.00%)_Space_69.07_(100.00%)
% #Algorithm_II_Day_1_Binary_Search #Binary_Search_I_Day_5 #Top_Interview_150_Binary_Search
% #Big_O_Time_O(log_n)_Space_O(1) #2025_01_12_Time_1_(100.00%)_Space_69.07_(100.00%)

-spec search_range(Nums :: [integer()], Target :: integer()) -> [integer()].
search_range(Nums, Target) ->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
% #Easy #Top_100_Liked_Questions #Array #Binary_Search #Algorithm_I_Day_1_Binary_Search
% #Binary_Search_I_Day_2 #Big_O_Time_O(log_n)_Space_O(1)
% #Binary_Search_I_Day_2 #Top_Interview_150_Binary_Search #Big_O_Time_O(log_n)_Space_O(1)
% #2025_01_12_Time_0_(100.00%)_Space_64.33_(_%)

-spec search_insert(Nums :: [integer()], Target :: integer()) -> integer().
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
% #Medium #Top_100_Liked_Questions #Array #Backtracking #Algorithm_II_Day_10_Recursion_Backtracking
% #Level_2_Day_20_Brute_Force/Backtracking #Udemy_Backtracking/Recursion
% #Big_O_Time_O(2^n)_Space_O(n+2^n) #2025_01_12_Time_0_(100.00%)_Space_58.87_(100.00%)
% #Top_Interview_150_Backtracking #Big_O_Time_O(2^n)_Space_O(n+2^n)
% #2025_01_12_Time_0_(100.00%)_Space_58.87_(100.00%)

-spec combination_sum(Candidates :: [integer()], Target :: integer()) -> [[integer()]].

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
% #Hard #Top_100_Liked_Questions #Top_Interview_Questions #Array #Dynamic_Programming #Two_Pointers
% #Stack #Monotonic_Stack #Dynamic_Programming_I_Day_9 #Udemy_Two_Pointers
% #Big_O_Time_O(n)_Space_O(1) #2025_01_12_Time_2_(100.00%)_Space_76.42_(100.00%)
% #Top_Interview_150_Array/String #Big_O_Time_O(n)_Space_O(1)
% #2025_01_12_Time_2_(100.00%)_Space_76.42_(100.00%)

-spec trap(Height :: [integer()]) -> integer().
trap(Height) ->
Expand Down
3 changes: 2 additions & 1 deletion src/main/erlang/g0001_0100/s0045_jump_game_ii/Solution.erl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
% #Medium #Top_100_Liked_Questions #Array #Dynamic_Programming #Greedy
% #Algorithm_II_Day_13_Dynamic_Programming #Dynamic_Programming_I_Day_4
% #Big_O_Time_O(n)_Space_O(1) #2025_01_12_Time_488_(100.00%)_Space_66.60_(100.00%)
% #Top_Interview_150_Array/String #Big_O_Time_O(n)_Space_O(1)
% #2025_01_12_Time_488_(100.00%)_Space_66.60_(100.00%)

-spec jump(Nums :: [integer()]) -> integer().
jump(Nums) ->
Expand Down
2 changes: 1 addition & 1 deletion src/main/erlang/g0001_0100/s0046_permutations/Solution.erl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
% #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Array #Backtracking
% #Algorithm_I_Day_11_Recursion_Backtracking #Level_2_Day_20_Brute_Force/Backtracking
% #Udemy_Backtracking/Recursion #Big_O_Time_O(n*n!)_Space_O(n+n!)
% #Udemy_Backtracking/Recursion #Top_Interview_150_Backtracking #Big_O_Time_O(n*n!)_Space_O(n+n!)
% #2025_01_12_Time_0_(100.00%)_Space_59.22_(100.00%)

-spec permute(Nums :: [integer()]) -> [[integer()]].
Expand Down
3 changes: 2 additions & 1 deletion src/main/erlang/g0001_0100/s0049_group_anagrams/Solution.erl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
% #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Array #String #Hash_Table #Sorting
% #Data_Structure_II_Day_8_String #Programming_Skills_II_Day_11 #Udemy_Strings
% #Big_O_Time_O(n*k_log_k)_Space_O(n) #2025_01_15_Time_13_(90.00%)_Space_73.34_(100.00%)
% #Top_Interview_150_Hashmap #Big_O_Time_O(n*k_log_k)_Space_O(n)
% #2025_01_15_Time_13_(90.00%)_Space_73.34_(100.00%)

-spec group_anagrams(Strs :: [unicode:unicode_binary()]) -> [[unicode:unicode_binary()]].
group_anagrams(Strs) ->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
% #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Array #Dynamic_Programming
% #Divide_and_Conquer #Data_Structure_I_Day_1_Array #Dynamic_Programming_I_Day_5
% #Udemy_Famous_Algorithm #Big_O_Time_O(n)_Space_O(1)
% #Udemy_Famous_Algorithm #Top_Interview_150_Kadane's_Algorithm #Big_O_Time_O(n)_Space_O(1)
% #2025_01_12_Time_4_(100.00%)_Space_146.33_(_%)

-spec max_sub_array(Nums :: [integer()]) -> integer().
Expand Down
3 changes: 2 additions & 1 deletion src/main/erlang/g0001_0100/s0055_jump_game/Solution.erl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
% #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Array #Dynamic_Programming #Greedy
% #Algorithm_II_Day_12_Dynamic_Programming #Dynamic_Programming_I_Day_4 #Udemy_Arrays
% #Big_O_Time_O(n)_Space_O(1) #2025_01_12_Time_2_(100.00%)_Space_77.54_(100.00%)
% #Top_Interview_150_Array/String #Big_O_Time_O(n)_Space_O(1)
% #2025_01_12_Time_2_(100.00%)_Space_77.54_(100.00%)

-spec can_jump(Nums :: [integer()]) -> boolean().
can_jump([E|Nums]) ->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
% #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Array #Sorting
% #Data_Structure_II_Day_2_Array #Level_2_Day_17_Interval #Udemy_2D_Arrays/Matrix
% #Big_O_Time_O(n_log_n)_Space_O(n) #2025_01_13_Time_8_(100.00%)_Space_70.88_(100.00%)
% #Top_Interview_150_Intervals #Big_O_Time_O(n_log_n)_Space_O(n)
% #2025_01_13_Time_8_(100.00%)_Space_70.88_(100.00%)

-spec merge(Intervals :: [[integer()]]) -> [[integer()]].
merge(Intervals) ->
Expand Down
4 changes: 2 additions & 2 deletions src/main/erlang/g0001_0100/s0070_climbing_stairs/Solution.erl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
% #Easy #Top_100_Liked_Questions #Top_Interview_Questions #Dynamic_Programming #Math #Memoization
% #Algorithm_I_Day_12_Dynamic_Programming #Dynamic_Programming_I_Day_2
% #Level_1_Day_10_Dynamic_Programming #Udemy_Dynamic_Programming #Big_O_Time_O(n)_Space_O(n)
% #2025_01_13_Time_0_(100.00%)_Space_58.51_(100.00%)
% #Level_1_Day_10_Dynamic_Programming #Udemy_Dynamic_Programming #Top_Interview_150_1D_DP
% #Big_O_Time_O(n)_Space_O(n) #2025_01_13_Time_0_(100.00%)_Space_58.51_(100.00%)

-spec climb_stairs(N :: integer()) -> integer().
climb_stairs(N) ->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
% #Medium #Top_100_Liked_Questions #String #Dynamic_Programming
% #Algorithm_II_Day_18_Dynamic_Programming #Dynamic_Programming_I_Day_19
% #Udemy_Dynamic_Programming #Big_O_Time_O(n^2)_Space_O(n2)
% #Udemy_Dynamic_Programming #Top_Interview_150_Multidimensional_DP #Big_O_Time_O(n^2)_Space_O(n2)
% #2025_01_13_Time_251_(100.00%)_Space_122.91_(100.00%)

-spec min_distance(Word1 :: unicode:unicode_binary(), Word2 :: unicode:unicode_binary()) -> integer().
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
% #Medium #Top_100_Liked_Questions #Array #Binary_Search #Matrix #Data_Structure_I_Day_5_Array
% #Algorithm_II_Day_1_Binary_Search #Binary_Search_I_Day_8 #Level_2_Day_8_Binary_Search
% #Udemy_2D_Arrays/Matrix #Big_O_Time_O(endRow+endCol)_Space_O(1)
% #Udemy_2D_Arrays/Matrix #Top_Interview_150_Binary_Search #Big_O_Time_O(endRow+endCol)_Space_O(1)
% #2025_01_13_Time_0_(100.00%)_Space_61.38_(100.00%)

-spec search_matrix(Matrix :: [[integer()]], Target :: integer()) -> boolean().
Expand Down
4 changes: 2 additions & 2 deletions src/main/erlang/g0001_0100/s0079_word_search/Solution.erl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
% #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Array #Matrix #Backtracking
% #Algorithm_II_Day_11_Recursion_Backtracking #Big_O_Time_O(4^(m*n))_Space_O(m*n)
% #2025_01_14_Time_7_(100.00%)_Space_62.90_(100.00%)
% #Algorithm_II_Day_11_Recursion_Backtracking #Top_Interview_150_Backtracking
% #Big_O_Time_O(4^(m*n))_Space_O(m*n) #2025_01_14_Time_7_(100.00%)_Space_62.90_(100.00%)

-spec exist(Board :: [[char()]], Word :: unicode:unicode_binary()) -> boolean().

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
% #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Depth_First_Search #Tree #Binary_Tree
% #Binary_Search_Tree #Data_Structure_I_Day_14_Tree #Level_1_Day_8_Binary_Search_Tree
% #Udemy_Tree_Stack_Queue #Big_O_Time_O(N)_Space_O(log(N))
% #Udemy_Tree_Stack_Queue #Top_Interview_150_Binary_Search_Tree #Big_O_Time_O(N)_Space_O(log(N))
% #2025_01_14_Time_0_(100.00%)_Space_73.36_(100.00%)

%% Definition for a binary tree node.
Expand Down
3 changes: 2 additions & 1 deletion src/main/erlang/g0101_0200/s0101_symmetric_tree/Solution.erl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
% #Easy #Top_100_Liked_Questions #Top_Interview_Questions #Depth_First_Search #Breadth_First_Search
% #Tree #Binary_Tree #Data_Structure_I_Day_11_Tree #Level_2_Day_15_Tree
% #Big_O_Time_O(N)_Space_O(log(N)) #2025_01_15_Time_0_(100.00%)_Space_63.92_(_%)
% #Top_Interview_150_Binary_Tree_General #Big_O_Time_O(N)_Space_O(log(N))
% #2025_01_15_Time_0_(100.00%)_Space_63.92_(_%)

%% Definition for a binary tree node.
%%
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
% #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Breadth_First_Search #Tree
% #Binary_Tree #Data_Structure_I_Day_11_Tree #Level_1_Day_6_Tree #Udemy_Tree_Stack_Queue
% #Big_O_Time_O(N)_Space_O(N) #2025_01_15_Time_12_(100.00%)_Space_65.00_(100.00%)
% #Top_Interview_150_Binary_Tree_BFS #Big_O_Time_O(N)_Space_O(N)
% #2025_01_15_Time_12_(100.00%)_Space_65.00_(100.00%)

%% Definition for a binary tree node.
%%
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
% #Easy #Top_100_Liked_Questions #Top_Interview_Questions #Depth_First_Search #Breadth_First_Search
% #Tree #Binary_Tree #Data_Structure_I_Day_11_Tree
% #Programming_Skills_I_Day_10_Linked_List_and_Tree #Udemy_Tree_Stack_Queue
% #Big_O_Time_O(N)_Space_O(H) #2025_01_15_Time_0_(100.00%)_Space_67.90_(50.00%)
% #Top_Interview_150_Binary_Tree_General #Big_O_Time_O(N)_Space_O(H)
% #2025_01_15_Time_0_(100.00%)_Space_67.90_(50.00%)

%% Definition for a binary tree node.
%%
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
% #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Array #Hash_Table #Tree #Binary_Tree
% #Divide_and_Conquer #Data_Structure_II_Day_15_Tree #Big_O_Time_O(N)_Space_O(N)
% #2025_01_15_Time_169_(100.00%)_Space_66.76_(100.00%)
% #Divide_and_Conquer #Data_Structure_II_Day_15_Tree #Top_Interview_150_Binary_Tree_General
% #Big_O_Time_O(N)_Space_O(N) #2025_01_15_Time_169_(100.00%)_Space_66.76_(100.00%)

%% Definition for a binary tree node.
%%
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
% #Easy #Top_100_Liked_Questions #Top_Interview_Questions #Array #Dynamic_Programming
% #Data_Structure_I_Day_3_Array #Dynamic_Programming_I_Day_7 #Level_1_Day_5_Greedy #Udemy_Arrays
% #Big_O_Time_O(N)_Space_O(1) #2025_01_15_Time_89_(100.00%)_Space_115.84_(100.00%)
% #Top_Interview_150_Array/String #Big_O_Time_O(N)_Space_O(1)
% #2025_01_15_Time_89_(100.00%)_Space_115.84_(100.00%)

-spec max_profit(Prices :: [integer()]) -> integer().
-import(lists, [max/1, min/1]).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
% #Hard #Top_100_Liked_Questions #Top_Interview_Questions #Dynamic_Programming #Depth_First_Search
% #Tree #Binary_Tree #Udemy_Tree_Stack_Queue #Big_O_Time_O(N)_Space_O(N)
% #2025_01_16_Time_4_(100.00%)_Space_89.51_(100.00%)
% #Tree #Binary_Tree #Udemy_Tree_Stack_Queue #Top_Interview_150_Binary_Tree_General
% #Big_O_Time_O(N)_Space_O(N) #2025_01_16_Time_4_(100.00%)_Space_89.51_(100.00%)

%% Definition for a binary tree node.
%%
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
% #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Array #Hash_Table #Union_Find
% #Big_O_Time_O(N_log_N)_Space_O(1) #2025_01_16_Time_42_(100.00%)_Space_206.53_(100.00%)
% #Top_Interview_150_Hashmap #Big_O_Time_O(N_log_N)_Space_O(1)
% #2025_01_16_Time_42_(100.00%)_Space_206.53_(100.00%)

-spec longest_consecutive(Nums :: [integer()]) -> integer().
longest_consecutive(Nums) ->
Expand Down
3 changes: 2 additions & 1 deletion src/main/erlang/g0101_0200/s0136_single_number/Solution.erl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
% #Easy #Top_100_Liked_Questions #Top_Interview_Questions #Array #Bit_Manipulation
% #Data_Structure_II_Day_1_Array #Algorithm_I_Day_14_Bit_Manipulation #Udemy_Integers
% #Big_O_Time_O(N)_Space_O(1) #2025_01_16_Time_0_(100.00%)_Space_72.99_(100.00%)
% #Top_Interview_150_Bit_Manipulation #Big_O_Time_O(N)_Space_O(1)
% #2025_01_16_Time_0_(100.00%)_Space_72.99_(100.00%)

-spec single_number(Nums :: [integer()]) -> integer().
single_number(Nums) ->
Expand Down
4 changes: 2 additions & 2 deletions src/main/erlang/g0101_0200/s0139_word_break/Solution.erl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
% #Medium #Top_100_Liked_Questions #Top_Interview_Questions #String #Hash_Table
% #Dynamic_Programming #Trie #Memoization #Algorithm_II_Day_15_Dynamic_Programming
% #Dynamic_Programming_I_Day_9 #Udemy_Dynamic_Programming #Big_O_Time_O(M+max*N)_Space_O(M+N+max)
% #2025_01_18_Time_1_(100.00%)_Space_60.03_(100.00%)
% #Dynamic_Programming_I_Day_9 #Udemy_Dynamic_Programming #Top_Interview_150_1D_DP
% #Big_O_Time_O(M+max*N)_Space_O(M+N+max) #2025_01_18_Time_1_(100.00%)_Space_60.03_(100.00%)

-spec word_break(S :: unicode:unicode_binary(), WordDict :: [unicode:unicode_binary()]) -> boolean().
word_break(S, WordDict) ->
Expand Down
4 changes: 2 additions & 2 deletions src/main/erlang/g0101_0200/s0146_lru_cache/LRUCache.erl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
% #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Hash_Table #Design #Linked_List
% #Doubly_Linked_List #Udemy_Linked_List #Big_O_Time_O(1)_Space_O(capacity)
% #2025_01_18_Time_312_(100.00%)_Space_273.78_(100.00%)
% #Doubly_Linked_List #Udemy_Linked_List #Top_Interview_150_Linked_List
% #Big_O_Time_O(1)_Space_O(capacity) #2025_01_18_Time_312_(100.00%)_Space_273.78_(100.00%)

%% Persistent Term Keys
-define(CAPACITY_KEY, {lru_cache, capacity}).
Expand Down
4 changes: 2 additions & 2 deletions src/main/erlang/g0101_0200/s0148_sort_list/Solution.erl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
% #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Sorting #Two_Pointers #Linked_List
% #Divide_and_Conquer #Merge_Sort #Level_2_Day_4_Linked_List #Big_O_Time_O(log(N))_Space_O(log(N))
% #2025_01_18_Time_43_(100.00%)_Space_102.77_(100.00%)
% #Divide_and_Conquer #Merge_Sort #Level_2_Day_4_Linked_List #Top_Interview_150_Divide_and_Conquer
% #Big_O_Time_O(log(N))_Space_O(log(N)) #2025_01_18_Time_43_(100.00%)_Space_102.77_(100.00%)

%% Definition for singly-linked list.
%%
Expand Down
Loading

0 comments on commit 0233451

Please sign in to comment.