File tree Expand file tree Collapse file tree 27 files changed +203
-203
lines changed
s0003_longest_substring_without_repeating_characters
s0004_median_of_two_sorted_arrays
s0005_longest_palindromic_substring
s0008_string_to_integer_atoi
s0010_regular_expression_matching
s0011_container_with_most_water
s0017_letter_combinations_of_a_phone_number
s0019_remove_nth_node_from_end_of_list
s0021_merge_two_sorted_lists
s0022_generate_parentheses
s0023_merge_k_sorted_lists
s0024_swap_nodes_in_pairs
s0025_reverse_nodes_in_k_group
s0032_longest_valid_parentheses
s0033_search_in_rotated_sorted_array
s0034_find_first_and_last_position_of_element_in_sorted_array
s0035_search_insert_position Expand file tree Collapse file tree 27 files changed +203
-203
lines changed Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change 1
1
// #Easy #Top_100_Liked_Questions #Top_Interview_Questions #Array #Hash_Table
2
2
// #Data_Structure_I_Day_2_Array #Level_1_Day_13_Hashmap #Udemy_Arrays #Top_Interview_150_Hashmap
3
3
// #Big_O_Time_O(n)_Space_O(n) #AI_can_be_used_to_solve_the_task
4
- // #2023_09_28_Time_54_ms_(91.72%)_Space_45.5_MB_(22.26 %)
4
+ // #2025_03_22_Time_1_ms_(89.70%)_Space_59.39_MB_(8.75 %)
5
5
6
6
function twoSum ( nums : number [ ] , target : number ) : number [ ] {
7
7
const indexMap : Map < number , number > = new Map ( )
Original file line number Diff line number Diff line change 1
1
// #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Math #Linked_List #Recursion
2
2
// #Data_Structure_II_Day_10_Linked_List #Programming_Skills_II_Day_15
3
3
// #Top_Interview_150_Linked_List #Big_O_Time_O(max(N,M))_Space_O(max(N,M))
4
- // #AI_can_be_used_to_solve_the_task #2023_09_28_Time_92_ms_(77.86%)_Space_48_MB_(69.29 %)
4
+ // #AI_can_be_used_to_solve_the_task #2025_03_22_Time_2_ms_(95.82%)_Space_62.80_MB_(21.07 %)
5
5
6
6
import { ListNode } from '../../com_github_leetcode/listnode'
7
7
Original file line number Diff line number Diff line change 1
1
// #Medium #Top_100_Liked_Questions #Top_Interview_Questions #String #Hash_Table #Sliding_Window
2
2
// #Algorithm_I_Day_6_Sliding_Window #Level_2_Day_14_Sliding_Window/Two_Pointer #Udemy_Strings
3
3
// #Top_Interview_150_Sliding_Window #Big_O_Time_O(n)_Space_O(1) #AI_can_be_used_to_solve_the_task
4
- // #2023_09_28_Time_65_ms_(90.77%)_Space_44.9_MB_(95.29 %)
4
+ // #2025_03_22_Time_3_ms_(96.91%)_Space_59.12_MB_(43.55 %)
5
5
6
6
function lengthOfLongestSubstring ( s : string ) : number {
7
7
const lastIndices : number [ ] = new Array ( 256 ) . fill ( - 1 )
Original file line number Diff line number Diff line change 1
1
// #Hard #Top_100_Liked_Questions #Top_Interview_Questions #Array #Binary_Search #Divide_and_Conquer
2
2
// #Top_Interview_150_Binary_Search #Big_O_Time_O(log(min(N,M)))_Space_O(1)
3
- // #AI_can_be_used_to_solve_the_task #2023_08_26_Time_86_ms_(92.15%)_Space_48.3_MB_(59.73 %)
3
+ // #AI_can_be_used_to_solve_the_task #2025_03_22_Time_3_ms_(82.74%)_Space_59.34_MB_(44.01 %)
4
4
5
5
function findMedianSortedArrays ( nums1 : number [ ] , nums2 : number [ ] ) : number {
6
6
const nums = nums1 . concat ( nums2 )
Original file line number Diff line number Diff line change 1
1
// #Medium #Top_100_Liked_Questions #Top_Interview_Questions #String #Dynamic_Programming
2
2
// #Data_Structure_II_Day_9_String #Algorithm_II_Day_14_Dynamic_Programming
3
3
// #Dynamic_Programming_I_Day_17 #Udemy_Strings #Top_Interview_150_Multidimensional_DP
4
- // #Big_O_Time_O(n)_Space_O(n) #2023_09_28_Time_68_ms_(95.34%)_Space_44.5_MB_(96.58 %)
4
+ // #Big_O_Time_O(n)_Space_O(n) #2025_03_22_Time_8_ms_(99.14%)_Space_59.13_MB_(33.28 %)
5
5
6
6
function longestPalindrome ( s : string ) : string {
7
7
const newStr : string [ ] = new Array ( s . length * 2 + 1 )
Original file line number Diff line number Diff line change 1
1
// #Medium #String #Top_Interview_150_Array/String
2
- // #2023_08_26_Time_64_ms_(95.38%)_Space_47.3_MB_(64.49 %)
2
+ // #2025_03_22_Time_2_ms_(99.08%)_Space_60.88_MB_(31.04 %)
3
3
4
4
function convert ( s : string , numRows : number ) : string {
5
5
if ( numRows < 2 ) {
Original file line number Diff line number Diff line change 1
1
// #Medium #Top_Interview_Questions #Math #Udemy_Integers
2
- // #2023_08_25_Time_56_ms_(95.68%)_Space_43.8_MB_(99.70 %)
2
+ // #2025_03_22_Time_53_ms_(83.14%)_Space_58.56_MB_(6.02 %)
3
3
4
4
function reverse ( x : number ) : number {
5
5
let remaining = Math . abs ( x )
Original file line number Diff line number Diff line change 1
- // #Medium #Top_Interview_Questions #String #2023_08_25_Time_56_ms_(99.01%)_Space_44_MB_(98.27 %)
1
+ // #Medium #Top_Interview_Questions #String #2025_03_22_Time_1_ms_(90.14%)_Space_58.06_MB_(42.36 %)
2
2
3
3
function myAtoi ( s : string ) : number {
4
4
s = s . trim ( )
Original file line number Diff line number Diff line change 1
1
// #Easy #Math #Udemy_Integers #Top_Interview_150_Math
2
- // #2023_08_25_Time_137_ms_(88.64%)_Space_50.5_MB_(99.43 %)
2
+ // #2025_03_22_Time_3_ms_(99.14%)_Space_64.18_MB_(50.40 %)
3
3
4
4
function isPalindrome ( x : number ) : boolean {
5
5
if ( x < 0 ) {
Original file line number Diff line number Diff line change 1
1
// #Hard #Top_Interview_Questions #String #Dynamic_Programming #Recursion #Udemy_Dynamic_Programming
2
- // #Big_O_Time_O(m*n)_Space_O(m*n) #2023_08_25_Time_69_ms_(92.65%)_Space_45.9_MB_(50.61 %)
2
+ // #Big_O_Time_O(m*n)_Space_O(m*n) #2025_03_22_Time_5_ms_(90.44%)_Space_59.10_MB_(22.68 %)
3
3
4
4
function isMatch ( s : string , p : string ) : boolean { // NOSONAR
5
5
const result = new Array ( s . length + 1 )
Original file line number Diff line number Diff line change 1
1
// #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Array #Greedy #Two_Pointers
2
2
// #Algorithm_II_Day_4_Two_Pointers #Top_Interview_150_Two_Pointers #Big_O_Time_O(n)_Space_O(1)
3
- // #2023_08_28_Time_57_ms_(98.23%)_Space_50.9_MB_(84.15 %)
3
+ // #2025_03_22_Time_2_ms_(80.13%)_Space_65.63_MB_(10.65 %)
4
4
5
5
function maxArea ( height : number [ ] ) : number {
6
6
let maxArea = - 1
Original file line number Diff line number Diff line change 1
1
// #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Array #Sorting #Two_Pointers
2
2
// #Data_Structure_II_Day_1_Array #Algorithm_II_Day_3_Two_Pointers #Udemy_Two_Pointers
3
3
// #Top_Interview_150_Two_Pointers #Big_O_Time_O(n*log(n))_Space_O(n^2)
4
- // #2023_08_28_Time_148_ms_(92.62%)_Space_59.1_MB_(70.24 %)
4
+ // #2025_03_22_Time_30_ms_(91.56%)_Space_74.61_MB_(11.14 %)
5
5
6
6
function threeSum ( nums : number [ ] ) : number [ ] [ ] { //NOSONAR
7
7
nums . sort ( ( a , b ) => a - b )
Original file line number Diff line number Diff line change 1
1
// #Medium #Top_100_Liked_Questions #Top_Interview_Questions #String #Hash_Table #Backtracking
2
2
// #Algorithm_II_Day_11_Recursion_Backtracking #Udemy_Backtracking/Recursion
3
3
// #Top_Interview_150_Backtracking #Big_O_Time_O(4^n)_Space_O(n)
4
- // #2023_08_28_Time_52_ms_(79.11%)_Space_43.7_MB_(37.41 %)
4
+ // #2025_03_22_Time_0_ms_(100.00%)_Space_56.27_MB_(8.55 %)
5
5
6
6
function letterCombinations ( digits : string ) : string [ ] {
7
7
if ( digits . length === 0 ) {
Original file line number Diff line number Diff line change 1
1
// #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Two_Pointers #Linked_List
2
2
// #Algorithm_I_Day_5_Two_Pointers #Level_2_Day_3_Linked_List #Top_Interview_150_Linked_List
3
- // #Big_O_Time_O(L)_Space_O(L) #2023_08_28_Time_54_ms_(87.87%)_Space_44.7_MB_(49.30 %)
3
+ // #Big_O_Time_O(L)_Space_O(L) #2025_03_22_Time_0_ms_(100.00%)_Space_58.00_MB_(13.12 %)
4
4
5
5
import { ListNode } from '../../com_github_leetcode/listnode'
6
6
Original file line number Diff line number Diff line change 1
1
// #Easy #Top_100_Liked_Questions #Top_Interview_Questions #String #Stack
2
2
// #Data_Structure_I_Day_9_Stack_Queue #Udemy_Strings #Top_Interview_150_Stack
3
- // #Big_O_Time_O(n)_Space_O(n) #2023_08_28_Time_50_ms_(95.90%)_Space_43.5_MB_(83 .27%)
3
+ // #Big_O_Time_O(n)_Space_O(n) #2025_03_22_Time_1_ms_(86.85%)_Space_59.18_MB_(9 .27%)
4
4
5
5
function isValid ( s : string ) : boolean {
6
6
const stack : string [ ] = [ ]
Original file line number Diff line number Diff line change 1
1
// #Easy #Top_100_Liked_Questions #Top_Interview_Questions #Linked_List #Recursion
2
2
// #Data_Structure_I_Day_7_Linked_List #Algorithm_I_Day_10_Recursion_Backtracking
3
3
// #Level_1_Day_3_Linked_List #Udemy_Linked_List #Top_Interview_150_Linked_List
4
- // #Big_O_Time_O(m+n)_Space_O(m+n) #2023_08_29_Time_59_ms_(86.77%)_Space_44_MB_(98.03 %)
4
+ // #Big_O_Time_O(m+n)_Space_O(m+n) #2025_03_22_Time_1_ms_(51.21%)_Space_59.28_MB_(6.60 %)
5
5
6
6
import { ListNode } from '../../com_github_leetcode/listnode'
7
7
Original file line number Diff line number Diff line change 1
1
// #Medium #Top_100_Liked_Questions #Top_Interview_Questions #String #Dynamic_Programming
2
2
// #Backtracking #Algorithm_II_Day_11_Recursion_Backtracking #Udemy_Backtracking/Recursion
3
3
// #Top_Interview_150_Backtracking #Big_O_Time_O(2^n)_Space_O(n)
4
- // #2023_08_29_Time_60_ms_(62.03%)_Space_45.6_MB_(21.59 %)
4
+ // #2025_03_22_Time_1_ms_(72.82%)_Space_56.97_MB_(44.53 %)
5
5
6
6
function generateParenthesis ( n : number ) : string [ ] {
7
7
const sb : string [ ] = [ ]
Original file line number Diff line number Diff line change 1
1
// #Hard #Top_100_Liked_Questions #Top_Interview_Questions #Heap_Priority_Queue #Linked_List
2
2
// #Divide_and_Conquer #Merge_Sort #Top_Interview_150_Divide_and_Conquer
3
- // #Big_O_Time_O(k*n*log(k))_Space_O(log(k)) #2023_10_09_Time_76_ms_(94.52%)_Space_47.9_MB_(84.35 %)
3
+ // #Big_O_Time_O(k*n*log(k))_Space_O(log(k)) #2025_03_22_Time_4_ms_(97.65%)_Space_64.08_MB_(30.06 %)
4
4
5
5
import { ListNode } from '../../com_github_leetcode/listnode'
6
6
Original file line number Diff line number Diff line change 1
1
// #Medium #Top_100_Liked_Questions #Linked_List #Recursion #Data_Structure_II_Day_12_Linked_List
2
2
// #Udemy_Linked_List #Big_O_Time_O(n)_Space_O(1)
3
- // #2023_08_29_Time_59_ms_(62.67%)_Space_44.7_MB_(26.03 %)
3
+ // #2025_03_22_Time_0_ms_(100.00%)_Space_56.52_MB_(6.71 %)
4
4
5
5
/**
6
6
* Definition for singly-linked list.
Original file line number Diff line number Diff line change 1
1
// #Hard #Top_100_Liked_Questions #Linked_List #Recursion #Data_Structure_II_Day_13_Linked_List
2
2
// #Udemy_Linked_List #Top_Interview_150_Linked_List #Big_O_Time_O(n)_Space_O(k)
3
- // #2023_08_29_Time_74_ms_(66.83%)_Space_46.1_MB_(94.47 %)
3
+ // #2025_03_22_Time_0_ms_(100.00%)_Space_60.66_MB_(27.50 %)
4
4
5
5
/**
6
6
* Definition for singly-linked list.
Original file line number Diff line number Diff line change 1
1
// #Medium #Top_100_Liked_Questions #Array #Two_Pointers #Big_O_Time_O(n)_Space_O(1)
2
- // #2023_09_26_Time_47_ms_(99.30%)_Space_45_MB_(20.98 %)
2
+ // #2025_03_22_Time_0_ms_(100.00%)_Space_58.80_MB_(7.83 %)
3
3
4
4
/*
5
5
Do not return anything, modify nums in-place instead.
Original file line number Diff line number Diff line change 1
1
// #Hard #Top_100_Liked_Questions #String #Dynamic_Programming #Stack #Big_O_Time_O(n)_Space_O(1)
2
- // #2023_09_26_Time_56_ms_(89.31%)_Space_43.9_MB_(100.00 %)
2
+ // #2025_03_22_Time_3_ms_(71.05%)_Space_58.66_MB_(24.21 %)
3
3
4
4
function longestValidParentheses ( s : string ) : number {
5
5
let open = 0
Original file line number Diff line number Diff line change 1
1
// #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Array #Binary_Search
2
2
// #Algorithm_II_Day_1_Binary_Search #Binary_Search_I_Day_11 #Level_2_Day_8_Binary_Search
3
3
// #Udemy_Binary_Search #Top_Interview_150_Binary_Search #Big_O_Time_O(log_n)_Space_O(1)
4
- // #2023_09_27_Time_43_ms_(98.54%)_Space_44.3_MB_(31.85 %)
4
+ // #2025_03_22_Time_0_ms_(100.00%)_Space_56.20_MB_(19.74 %)
5
5
6
6
function search ( nums : number [ ] , target : number ) : number { //NOSONAR
7
7
let lowEnd : number = 0
Original file line number Diff line number Diff line change 1
1
// #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Array #Binary_Search
2
2
// #Algorithm_II_Day_1_Binary_Search #Binary_Search_I_Day_5 #Top_Interview_150_Binary_Search
3
- // #Big_O_Time_O(log_n)_Space_O(1) #2023_09_27_Time_45_ms_(98.05%)_Space_44.5_MB_(54.86 %)
3
+ // #Big_O_Time_O(log_n)_Space_O(1) #2025_03_22_Time_0_ms_(100.00%)_Space_57.18_MB_(12.18 %)
4
4
5
5
function searchRange ( nums : number [ ] , target : number ) : number [ ] { //NOSONAR
6
6
let first = - 1
Original file line number Diff line number Diff line change 1
1
// #Easy #Top_100_Liked_Questions #Array #Binary_Search #Algorithm_I_Day_1_Binary_Search
2
2
// #Binary_Search_I_Day_2 #Top_Interview_150_Binary_Search #Big_O_Time_O(log_n)_Space_O(1)
3
- // #2023_09_27_Time_51_ms_(80.95%)_Space_44.6_MB_(16.67 %)
3
+ // #2025_03_22_Time_0_ms_(100.00%)_Space_56.30_MB_(12.51 %)
4
4
5
5
function searchInsert ( nums : number [ ] , target : number ) : number {
6
6
let left = 0
Original file line number Diff line number Diff line change 1
1
// #Medium #Top_100_Liked_Questions #Array #Backtracking #Algorithm_II_Day_10_Recursion_Backtracking
2
2
// #Level_2_Day_20_Brute_Force/Backtracking #Udemy_Backtracking/Recursion
3
3
// #Top_Interview_150_Backtracking #Big_O_Time_O(2^n)_Space_O(n+2^n)
4
- // #2023_09_29_Time_65_ms_(86.86%)_Space_45.8_MB_(75.98 %)
4
+ // #2025_03_22_Time_1_ms_(98.17%)_Space_61.61_MB_(21.40 %)
5
5
6
6
function combinationSum ( candidates : number [ ] , target : number ) : number [ ] [ ] {
7
7
const result : number [ ] [ ] = [ ]
You can’t perform that action at this time.
0 commit comments