Skip to content

Commit

Permalink
Improved racket
Browse files Browse the repository at this point in the history
  • Loading branch information
javadev committed Feb 10, 2025
1 parent 0233451 commit e213fa5
Show file tree
Hide file tree
Showing 85 changed files with 666 additions and 65 deletions.
2 changes: 1 addition & 1 deletion src/main/racket/g0001_0100/s0001_two_sum/Solution.rkt
Original file line number Diff line number Diff line change
@@ -1,7 +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 #Top_Interview_150_Hashmap
; #Big_O_Time_O(n)_Space_O(n) #AI_can_be_used_to_solve_the_task
; #2025_02_05_Time_0_(100.00%)_Space_102.04_(40.82%)
; #2025_02_05_Time_0_ms_(100.00%)_Space_102.04_MB_(40.82%)

(define (two-sum-iter nums target hash index)
(cond
Expand Down
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
; #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_02_05_Time_0_(100.00%)_Space_128.08_(72.73%)
; #AI_can_be_used_to_solve_the_task #2025_02_05_Time_0_ms_(100.00%)_Space_128.08_MB_(72.73%)

; Definition for singly-linked list:
#|
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 #Hash_Table #Sliding_Window
; #Algorithm_I_Day_6_Sliding_Window #Level_2_Day_14_Sliding_Window/Two_Pointer #Udemy_Strings
; #Top_Interview_150_Sliding_Window #Big_O_Time_O(n)_Space_O(1) #AI_can_be_used_to_solve_the_task
; #2025_02_06_Time_119_(71.43%)_Space_131.37_(28.57%)
; #2025_02_06_Time_119_ms_(71.43%)_Space_131.37_MB_(28.57%)

; Helper function to get the sublist up to 'v' excluded.
(define (take-till q v)
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
; #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_02_06_Time_0_(100.00%)_Space_128.80_(25.00%)
; #AI_can_be_used_to_solve_the_task #2025_02_06_Time_0_ms_(100.00%)_Space_128.80_MB_(25.00%)

(define/contract (find-median-sorted-arrays nums1 nums2)
(-> (listof exact-integer?) (listof exact-integer?) flonum?)
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 #Top_Interview_150_Multidimensional_DP
; #Big_O_Time_O(n)_Space_O(n) #2025_02_06_Time_4_(100.00%)_Space_101.40_(85.71%)
; #Big_O_Time_O(n)_Space_O(n) #2025_02_06_Time_4_ms_(100.00%)_Space_101.40_MB_(85.71%)

(define (longest-palindrome s)
(define (expand-around-center s left right)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
; #Medium #String #Top_Interview_150_Array/String
; #2025_02_03_Time_57_(100.00%)_Space_130.82_(60.00%)
; #2025_02_03_Time_57_ms_(100.00%)_Space_130.82_MB_(60.00%)

(define/contract (convert s numRows)
(-> string? exact-integer? string?)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
; #Medium #Top_Interview_Questions #Math #Udemy_Integers
; #2025_02_03_Time_204_(100.00%)_Space_101.45_(100.00%)
; #2025_02_03_Time_204_ms_(100.00%)_Space_101.45_MB_(100.00%)

(define/contract (reverse x)
(-> exact-integer? exact-integer?)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; #Medium #Top_Interview_Questions #String #2025_02_03_Time_3_(100.00%)_Space_101.64_(100.00%)
; #Medium #Top_Interview_Questions #String
; #2025_02_03_Time_3_ms_(100.00%)_Space_101.64_MB_(100.00%)

(define/contract (my-atoi s)
(-> string? exact-integer?)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
; #Easy #Math #Udemy_Integers #Top_Interview_150_Math
; #2025_02_03_Time_8_(100.00%)_Space_129.01_(88.24%)
; #2025_02_03_Time_8_ms_(100.00%)_Space_129.01_MB_(88.24%)

(define/contract (is-palindrome x)
(-> exact-integer? boolean?)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
; #Hard #Top_Interview_Questions #String #Dynamic_Programming #Recursion #Udemy_Dynamic_Programming
; #Big_O_Time_O(m*n)_Space_O(m*n) #2025_02_03_Time_11_(100.00%)_Space_101.36_(100.00%)
; #Big_O_Time_O(m*n)_Space_O(m*n) #2025_02_03_Time_11_ms_(100.00%)_Space_101.36_MB_(100.00%)

(define (regex-state s is-star)
(list s (if is-star '* '1)))
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 #Greedy #Two_Pointers
; #Algorithm_II_Day_4_Two_Pointers #Top_Interview_150_Two_Pointers #Big_O_Time_O(n)_Space_O(1)
; #2025_02_03_Time_32_(100.00%)_Space_130.58_(100.00%)
; #2025_02_03_Time_32_ms_(100.00%)_Space_130.58_MB_(100.00%)

(define/contract (max-area height)
(-> (listof exact-integer?) exact-integer?)
Expand Down
2 changes: 1 addition & 1 deletion src/main/racket/g0001_0100/s0015_3sum/Solution.rkt
Original file line number Diff line number Diff line change
@@ -1,7 +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
; #Top_Interview_150_Two_Pointers #Big_O_Time_O(n*log(n))_Space_O(n^2)
; #2025_02_03_Time_999_(100.00%)_Space_130.90_(100.00%)
; #2025_02_03_Time_999_ms_(100.00%)_Space_130.90_MB_(100.00%)

(define (bin-search val left right items)
(cond [(> left right) #f]
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 #Hash_Table #Backtracking
; #Algorithm_II_Day_11_Recursion_Backtracking #Udemy_Backtracking/Recursion
; #Top_Interview_150_Backtracking #Big_O_Time_O(4^n)_Space_O(n)
; #2025_02_03_Time_0_(100.00%)_Space_102.48_(_%)
; #2025_02_03_Time_0_ms_(100.00%)_Space_102.48_MB_(_%)

(define (letter-combinations digits)
(let* ((letters (vector "" "" "abc" "def" "ghi" "jkl" "mno" "pqrs" "tuv" "wxyz"))
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 #Top_Interview_150_Linked_List
; #Big_O_Time_O(L)_Space_O(L) #2025_02_03_Time_0_(100.00%)_Space_101.91_(_%)
; #Big_O_Time_O(L)_Space_O(L) #2025_02_03_Time_0_ms_(100.00%)_Space_101.91_MB_(_%)

; 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 #Top_Interview_150_Stack
; #Big_O_Time_O(n)_Space_O(n) #2025_02_03_Time_98_(100.00%)_Space_130.80_(100.00%)
; #Big_O_Time_O(n)_Space_O(n) #2025_02_03_Time_98_ms_(100.00%)_Space_130.80_MB_(100.00%)

(define (is-left-paren c)
(or (eq? c #\u28)
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 #Top_Interview_150_Linked_List
; #Big_O_Time_O(m+n)_Space_O(m+n) #2025_02_03_Time_0_(100.00%)_Space_102.38_(66.67%)
; #Big_O_Time_O(m+n)_Space_O(m+n) #2025_02_03_Time_0_ms_(100.00%)_Space_102.38_MB_(66.67%)

; Definition for singly-linked list:
#|
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
; #Backtracking #Algorithm_II_Day_11_Recursion_Backtracking #Udemy_Backtracking/Recursion
; #Top_Interview_150_Backtracking #Big_O_Time_O(2^n)_Space_O(n)
; #2025_02_03_Time_3_(100.00%)_Space_101.96_(100.00%)
; #2025_02_03_Time_3_ms_(100.00%)_Space_101.96_MB_(100.00%)

(define (generate-parenthesis n)
(let ([res '()])
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
; #Hard #Top_100_Liked_Questions #Top_Interview_Questions #Heap_Priority_Queue #Linked_List
; #Divide_and_Conquer #Merge_Sort #Top_Interview_150_Divide_and_Conquer
; #Big_O_Time_O(k*n*log(k))_Space_O(log(k)) #2025_02_03_Time_306_(100.00%)_Space_130.68_(100.00%)
; #Big_O_Time_O(k*n*log(k))_Space_O(log(k))
; #2025_02_03_Time_306_ms_(100.00%)_Space_130.68_MB_(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 #Linked_List #Recursion #Data_Structure_II_Day_12_Linked_List
; #Udemy_Linked_List #Big_O_Time_O(n)_Space_O(1)
; #2025_02_03_Time_0_(100.00%)_Space_101.59_(100.00%)
; #2025_02_03_Time_0_ms_(100.00%)_Space_101.59_MB_(100.00%)

; Definition for singly-linked list:
#|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
; #Hard #Top_100_Liked_Questions #Linked_List #Recursion #Data_Structure_II_Day_13_Linked_List
; #Udemy_Linked_List #Top_Interview_150_Linked_List #Big_O_Time_O(n)_Space_O(k)
; #2025_02_03_Time_0_(100.00%)_Space_101.65_(100.00%)
; #2025_02_03_Time_0_ms_(100.00%)_Space_101.65_MB_(100.00%)

; Definition for singly-linked list:
#|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
; #Hard #Top_100_Liked_Questions #String #Dynamic_Programming #Stack #Big_O_Time_O(n)_Space_O(1)
; #2025_02_03_Time_3_(100.00%)_Space_101.36_(100.00%)
; #2025_02_03_Time_3_ms_(100.00%)_Space_101.36_MB_(100.00%)

(define/contract (longest-valid-parentheses s)
(-> string? exact-integer?)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
; #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 #Top_Interview_150_Binary_Search #Big_O_Time_O(log_n)_Space_O(1)
; #2025_02_03_Time_0_(100.00%)_Space_101.54_(100.00%)
; #2025_02_03_Time_0_ms_(100.00%)_Space_101.54_MB_(100.00%)

(define/contract (search nums target [index 0])
(-> (listof exact-integer?) exact-integer? exact-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 #Top_Interview_150_Binary_Search
; #Big_O_Time_O(log_n)_Space_O(1) #2025_02_03_Time_0_(100.00%)_Space_101.71_(66.67%)
; #Big_O_Time_O(log_n)_Space_O(1) #2025_02_03_Time_0_ms_(100.00%)_Space_101.71_MB_(66.67%)

(define (find-bound vec target first-val)
(define (ptr-narrow left right)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
; #Easy #Top_100_Liked_Questions #Array #Binary_Search #Algorithm_I_Day_1_Binary_Search
; #Binary_Search_I_Day_2 #Top_Interview_150_Binary_Search #Big_O_Time_O(log_n)_Space_O(1)
; #2025_02_03_Time_0_(100.00%)_Space_102.38_(_%)
; #2025_02_03_Time_0_ms_(100.00%)_Space_102.38_MB_(_%)

(define (search-insert nums target [low 0] [high (sub1 (length nums))])
(if (< high low)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +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
; #Top_Interview_150_Backtracking #Big_O_Time_O(2^n)_Space_O(n+2^n)
; #2025_02_03_Time_7_(100.00%)_Space_101.91_(50.00%)
; #2025_02_03_Time_7_ms_(100.00%)_Space_101.91_MB_(50.00%)

(define (create-task-rec elems target next-list result)
(if (= 0 (length next-list)) result
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
; #Hard #Top_100_Liked_Questions #Top_Interview_Questions #Array #Hash_Table #Udemy_Arrays
; #Big_O_Time_O(n)_Space_O(n) #2025_02_03_Time_11_(100.00%)_Space_132.67_(100.00%)
; #Big_O_Time_O(n)_Space_O(n) #2025_02_03_Time_11_ms_(100.00%)_Space_132.67_MB_(100.00%)

(define/contract (first-missing-positive nums)
(-> (listof exact-integer?) exact-integer?)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +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
; #Top_Interview_150_Array/String #Big_O_Time_O(n)_Space_O(1)
; #2025_02_03_Time_0_(100.00%)_Space_129.13_(100.00%)
; #2025_02_03_Time_0_ms_(100.00%)_Space_129.13_MB_(100.00%)

(define (trap height)
(define H (list->vector height))
Expand Down
2 changes: 1 addition & 1 deletion src/main/racket/g0001_0100/s0045_jump_game_ii/Solution.rkt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
; #Medium #Top_100_Liked_Questions #Array #Dynamic_Programming #Greedy
; #Algorithm_II_Day_13_Dynamic_Programming #Dynamic_Programming_I_Day_4
; #Top_Interview_150_Array/String #Big_O_Time_O(n)_Space_O(1)
; #2025_02_03_Time_631_(100.00%)_Space_132.16_(100.00%)
; #2025_02_03_Time_631_ms_(100.00%)_Space_132.16_MB_(100.00%)

(define (init-vec len)
(let ([prepare-vec (make-vector len 99999)])
Expand Down
2 changes: 1 addition & 1 deletion src/main/racket/g0001_0100/s0046_permutations/Solution.rkt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
; #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 #Top_Interview_150_Backtracking #Big_O_Time_O(n*n!)_Space_O(n+n!)
; #2025_02_03_Time_0_(100.00%)_Space_101.43_(66.67%)
; #2025_02_03_Time_0_ms_(100.00%)_Space_101.43_MB_(66.67%)

(define/contract (permute nums)
(-> (listof exact-integer?) (listof (listof exact-integer?)))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +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
; #Top_Interview_150_Hashmap #Big_O_Time_O(n*k_log_k)_Space_O(n)
; #2025_02_03_Time_72_(100.00%)_Space_131.77_(100.00%)
; #2025_02_03_Time_72_ms_(100.00%)_Space_131.77_MB_(100.00%)

(define (group-anagrams strs)
(group-by (compose1 (curryr sort char<?) string->list) strs))
2 changes: 1 addition & 1 deletion src/main/racket/g0001_0100/s0051_n_queens/Solution.rkt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
; #Hard #Top_100_Liked_Questions #Array #Backtracking #Big_O_Time_O(N!)_Space_O(N)
; #2025_02_03_Time_123_(100.00%)_Space_129.70_(100.00%)
; #2025_02_03_Time_123_ms_(100.00%)_Space_129.70_MB_(100.00%)

(define (reverse sequence)
(foldr (lambda (x y) (append y (list x))) `() sequence))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
; #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 #Top_Interview_150_Kadane's_Algorithm #Big_O_Time_O(n)_Space_O(1)
; #2025_02_03_Time_51_(100.00%)_Space_140.95_(100.00%)
; #2025_02_03_Time_51_ms_(100.00%)_Space_140.95_MB_(100.00%)

(define/contract (recur nums)
(-> (listof exact-integer?) pair?)
Expand Down
2 changes: 1 addition & 1 deletion src/main/racket/g0001_0100/s0055_jump_game/Solution.rkt
Original file line number Diff line number Diff line change
@@ -1,7 +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
; #Top_Interview_150_Array/String #Big_O_Time_O(n)_Space_O(1)
; #2025_02_03_Time_0_(100.00%)_Space_132.04_(_%)
; #2025_02_03_Time_0_ms_(100.00%)_Space_132.04_MB_(_%)

(define (can-jump L)
(let loop ([i 0] [arr L] [best 0] [N (length L)])
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +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
; #Top_Interview_150_Intervals #Big_O_Time_O(n_log_n)_Space_O(n)
; #2025_02_03_Time_474_(100.00%)_Space_131.06_(_%)
; #2025_02_03_Time_474_ms_(100.00%)_Space_131.06_MB_(_%)

(define/contract (merge intervals)
(-> (listof (listof exact-integer?)) (listof (listof exact-integer?)))
Expand Down
2 changes: 1 addition & 1 deletion src/main/racket/g0001_0100/s0062_unique_paths/Solution.rkt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
; #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Dynamic_Programming #Math
; #Combinatorics #Algorithm_II_Day_13_Dynamic_Programming #Dynamic_Programming_I_Day_15
; #Level_1_Day_11_Dynamic_Programming #Big_O_Time_O(m*n)_Space_O(m*n)
; #2025_02_03_Time_6_(100.00%)_Space_102.66_(100.00%)
; #2025_02_03_Time_6_ms_(100.00%)_Space_102.66_MB_(100.00%)

(define (calc-path! start end direction cache other-p)
(begin (if (string=? direction "v")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
; #Medium #Top_100_Liked_Questions #Array #Dynamic_Programming #Matrix
; #Dynamic_Programming_I_Day_16 #Udemy_Dynamic_Programming #Top_Interview_150_Multidimensional_DP
; #Big_O_Time_O(m*n)_Space_O(m*n) #2025_02_04_Time_92_(100.00%)_Space_133.91_(100.00%)
; #Big_O_Time_O(m*n)_Space_O(m*n) #2025_02_04_Time_92_ms_(100.00%)_Space_133.91_MB_(100.00%)

; dynamic programming helper function
(define (mpsAux grid curpos dpTable ub)
Expand Down
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 #Top_Interview_150_1D_DP
; #Big_O_Time_O(n)_Space_O(n) #2025_02_04_Time_0_(100.00%)_Space_101.51_(100.00%)
; #Big_O_Time_O(n)_Space_O(n) #2025_02_04_Time_0_ms_(100.00%)_Space_101.51_MB_(100.00%)

(define (clmHelp n hTable)
(cond
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
; #Medium #Top_100_Liked_Questions #String #Dynamic_Programming
; #Algorithm_II_Day_18_Dynamic_Programming #Dynamic_Programming_I_Day_19
; #Udemy_Dynamic_Programming #Top_Interview_150_Multidimensional_DP #Big_O_Time_O(n^2)_Space_O(n2)
; #2025_02_04_Time_4_(100.00%)_Space_102.31_(100.00%)
; #2025_02_04_Time_4_ms_(100.00%)_Space_102.31_MB_(100.00%)

(define/contract (min-distance word1 word2)
(-> string? string? exact-integer?)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
; #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 #Top_Interview_150_Binary_Search #Big_O_Time_O(endRow+endCol)_Space_O(1)
; #2025_02_04_Time_0_(100.00%)_Space_101.20_(100.00%)
; #2025_02_04_Time_0_ms_(100.00%)_Space_101.20_MB_(100.00%)

(define/contract (search-matrix matrix target)
(-> (listof (listof exact-integer?)) exact-integer? boolean?)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
; #Hard #Top_100_Liked_Questions #Top_Interview_Questions #String #Hash_Table #Sliding_Window
; #Level_2_Day_14_Sliding_Window/Two_Pointer #Top_Interview_150_Sliding_Window
; #Big_O_Time_O(s.length())_Space_O(1) #2025_02_04_Time_151_(100.00%)_Space_130.75_(100.00%)
; #Big_O_Time_O(s.length())_Space_O(1) #2025_02_04_Time_151_ms_(100.00%)_Space_130.75_MB_(100.00%)

(define (zip lst1 lst2)
(map cons lst1 lst2))
Expand Down
2 changes: 1 addition & 1 deletion src/main/racket/g0001_0100/s0078_subsets/Solution.rkt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
; #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Array #Bit_Manipulation #Backtracking
; #Algorithm_II_Day_9_Recursion_Backtracking #Udemy_Backtracking/Recursion
; #Big_O_Time_O(2^n)_Space_O(n*2^n) #2025_02_04_Time_0_(100.00%)_Space_101.30_(100.00%)
; #Big_O_Time_O(2^n)_Space_O(n*2^n) #2025_02_04_Time_0_ms_(100.00%)_Space_101.30_MB_(100.00%)

(define/contract (subset-recur nums ans)
(-> (listof exact-integer?) (listof (listof exact-integer?)) (listof (listof exact-integer?)))
Expand Down
2 changes: 1 addition & 1 deletion src/main/racket/g0001_0100/s0079_word_search/Solution.rkt
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 #Top_Interview_150_Backtracking
; #Big_O_Time_O(4^(m*n))_Space_O(m*n) #2025_02_07_Time_2517_(100.00%)_Space_130.64_(_%)
; #Big_O_Time_O(4^(m*n))_Space_O(m*n) #2025_02_07_Time_2517_ms_(100.00%)_Space_130.64_MB_(_%)

(define/contract (exist board word)
(-> (listof (listof char?)) string? boolean?)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
; #Easy #Top_100_Liked_Questions #Top_Interview_Questions #Depth_First_Search #Tree #Binary_Tree
; #Stack #Data_Structure_I_Day_10_Tree #Udemy_Tree_Stack_Queue #Big_O_Time_O(n)_Space_O(n)
; #2025_02_04_Time_0_(100.00%)_Space_101.40_(100.00%)
; #2025_02_04_Time_0_ms_(100.00%)_Space_101.40_MB_(100.00%)

; Definition for a binary tree node.
#|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
; #Medium #Dynamic_Programming #Math #Tree #Binary_Tree #Binary_Search_Tree
; #Dynamic_Programming_I_Day_11 #Big_O_Time_O(n)_Space_O(1)
; #2025_02_04_Time_0_(100.00%)_Space_101.40_(100.00%)
; #2025_02_04_Time_0_ms_(100.00%)_Space_101.40_MB_(100.00%)

(define/contract (num-trees n)
(-> exact-integer? exact-integer?)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
; #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 #Top_Interview_150_Binary_Search_Tree #Big_O_Time_O(N)_Space_O(log(N))
; #2025_02_04_Time_0_(100.00%)_Space_101.52_(100.00%)
; #2025_02_04_Time_0_ms_(100.00%)_Space_101.52_MB_(100.00%)

; Definition for a binary tree node.
#|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +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
; #Top_Interview_150_Binary_Tree_General #Big_O_Time_O(N)_Space_O(log(N))
; #2025_02_05_Time_0_(100.00%)_Space_102.16_(_%)
; #2025_02_05_Time_0_ms_(100.00%)_Space_102.16_MB_(_%)

; Definition for a binary tree node.
#|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +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
; #Top_Interview_150_Binary_Tree_BFS #Big_O_Time_O(N)_Space_O(N)
; #2025_02_05_Time_0_(100.00%)_Space_102.22_(40.00%)
; #2025_02_05_Time_0_ms_(100.00%)_Space_102.22_MB_(40.00%)

; Definition for a binary tree node.
#|
Expand Down
Loading

0 comments on commit e213fa5

Please sign in to comment.