Skip to content

Added tag LeetCode_75 #126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
196 changes: 98 additions & 98 deletions README.md

Large diffs are not rendered by default.

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_03_22_Time_2_ms_(80.13%)_Space_65.63_MB_(10.65%)
// #LeetCode_75_Two_Pointers #Algorithm_II_Day_4_Two_Pointers #Top_Interview_150_Two_Pointers
// #Big_O_Time_O(n)_Space_O(1) #2025_03_22_Time_2_ms_(80.13%)_Space_65.63_MB_(10.65%)

function maxArea(height: number[]): number {
let maxArea = -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 #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)
// #LeetCode_75_Backtracking #Algorithm_II_Day_11_Recursion_Backtracking
// #Udemy_Backtracking/Recursion #Top_Interview_150_Backtracking #Big_O_Time_O(4^n)_Space_O(n)
// #2025_03_22_Time_0_ms_(100.00%)_Space_56.27_MB_(8.55%)

function letterCombinations(digits: string): string[] {
Expand Down
6 changes: 3 additions & 3 deletions src/main/ts/g0001_0100/s0062_unique_paths/solution.ts
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_03_23_Time_0_ms_(100.00%)_Space_55.15_MB_(43.54%)
// #Combinatorics #LeetCode_75_DP/Multidimensional #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_03_23_Time_0_ms_(100.00%)_Space_55.15_MB_(43.54%)

function uniquePaths(m: number, n: number): number {
let aboveRow = Array(n).fill(1)
Expand Down
4 changes: 2 additions & 2 deletions src/main/ts/g0001_0100/s0069_sqrtx/solution.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// #Hard #Array #String #Simulation #Top_Interview_150_Array/String
// #2025_04_05_Time_0_ms_(100.00%)_Space_55.70_MB_(38.14%)
// #Easy #Top_Interview_Questions #Math #Binary_Search #Binary_Search_I_Day_4
// #Top_Interview_150_Math #2025_04_16_Time_1_ms_(74.84%)_Space_57.85_MB_(56.21%)

function mySqrt(x: number): number {
let low = 1
Expand Down
2 changes: 1 addition & 1 deletion src/main/ts/g0001_0100/s0072_edit_distance/solution.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// #Medium #Top_100_Liked_Questions #String #Dynamic_Programming
// #Medium #Top_100_Liked_Questions #String #Dynamic_Programming #LeetCode_75_DP/Multidimensional
// #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_03_23_Time_6_ms_(93.83%)_Space_61.09_MB_(45.68%)
Expand Down
4 changes: 2 additions & 2 deletions src/main/ts/g0001_0100/s0088_merge_sorted_array/solution.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// #Medium #Two_Pointers #Linked_List #Top_Interview_150_Linked_List
// #2025_04_05_Time_0_ms_(100.00%)_Space_58.16_MB_(62.07%)
// #Easy #Top_Interview_Questions #Array #Sorting #Two_Pointers #Data_Structure_I_Day_2_Array
// #Top_Interview_150_Array/String #2025_04_05_Time_0_ms_(100.00%)_Space_58.16_MB_(62.07%)

/**
* Do not return anything, modify nums1 in-place instead.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// #Easy #Top_100_Liked_Questions #Top_Interview_Questions #Depth_First_Search #Breadth_First_Search
// #Tree #Binary_Tree #Data_Structure_I_Day_11_Tree
// #Tree #Binary_Tree #LeetCode_75_Binary_Tree/DFS #Data_Structure_I_Day_11_Tree
// #Programming_Skills_I_Day_10_Linked_List_and_Tree #Udemy_Tree_Stack_Queue
// #Top_Interview_150_Binary_Tree_General #Big_O_Time_O(N)_Space_O(H)
// #2025_03_26_Time_0_ms_(100.00%)_Space_59.10_MB_(43.48%)
Expand Down
6 changes: 3 additions & 3 deletions src/main/ts/g0101_0200/s0136_single_number/solution.ts
Original file line number Diff line number Diff line change
@@ -1,7 +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
// #Top_Interview_150_Bit_Manipulation #Big_O_Time_O(N)_Space_O(1)
// #2025_03_26_Time_1_ms_(78.27%)_Space_58.44_MB_(41.08%)
// #LeetCode_75_Bit_Manipulation #Data_Structure_II_Day_1_Array
// #Algorithm_I_Day_14_Bit_Manipulation #Udemy_Integers #Top_Interview_150_Bit_Manipulation
// #Big_O_Time_O(N)_Space_O(1) #2025_03_26_Time_1_ms_(78.27%)_Space_58.44_MB_(41.08%)

function singleNumber(nums: number[]): number {
let ans = 0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// #Medium #String #Two_Pointers #Udemy_Strings #Top_Interview_150_Array/String
// #2025_04_08_Time_0_ms_(100.00%)_Space_57.70_MB_(48.75%)
// #Medium #String #Two_Pointers #LeetCode_75_Array/String #Udemy_Strings
// #Top_Interview_150_Array/String #2025_04_08_Time_0_ms_(100.00%)_Space_57.70_MB_(48.75%)

function reverseWords(s: string): string {
return s
Expand Down
4 changes: 2 additions & 2 deletions src/main/ts/g0101_0200/s0162_find_peak_element/solution.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// #Medium #Top_Interview_Questions #Array #Binary_Search #Algorithm_II_Day_2_Binary_Search
// #Binary_Search_II_Day_12 #Top_Interview_150_Binary_Search
// #Medium #Top_Interview_Questions #Array #Binary_Search #LeetCode_75_Binary_Search
// #Algorithm_II_Day_2_Binary_Search #Binary_Search_II_Day_12 #Top_Interview_150_Binary_Search
// #2025_04_08_Time_0_ms_(100.00%)_Space_55.40_MB_(60.85%)

function findPeakElement(nums: number[]): number {
Expand Down
2 changes: 1 addition & 1 deletion src/main/ts/g0101_0200/s0198_house_robber/solution.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Array #Dynamic_Programming
// #Algorithm_I_Day_12_Dynamic_Programming #Dynamic_Programming_I_Day_3
// #LeetCode_75_DP/1D #Algorithm_I_Day_12_Dynamic_Programming #Dynamic_Programming_I_Day_3
// #Level_2_Day_12_Dynamic_Programming #Udemy_Dynamic_Programming #Top_Interview_150_1D_DP
// #Big_O_Time_O(n)_Space_O(n) #2025_03_26_Time_0_ms_(100.00%)_Space_55.74_MB_(28.06%)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// #Medium #Top_100_Liked_Questions #Depth_First_Search #Breadth_First_Search #Tree #Binary_Tree
// #Data_Structure_II_Day_16_Tree #Level_2_Day_15_Tree #Top_Interview_150_Binary_Tree_BFS
// #2025_04_10_Time_0_ms_(100.00%)_Space_56.98_MB_(73.71%)
// #LeetCode_75_Binary_Tree/BFS #Data_Structure_II_Day_16_Tree #Level_2_Day_15_Tree
// #Top_Interview_150_Binary_Tree_BFS #2025_04_10_Time_0_ms_(100.00%)_Space_56.98_MB_(73.71%)

import { TreeNode } from '../../com_github_leetcode/treenode'

Expand Down
6 changes: 3 additions & 3 deletions src/main/ts/g0201_0300/s0206_reverse_linked_list/solution.ts
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_8_Linked_List #Algorithm_I_Day_10_Recursion_Backtracking
// #Level_1_Day_3_Linked_List #Udemy_Linked_List #Big_O_Time_O(N)_Space_O(1)
// #2025_03_26_Time_0_ms_(100.00%)_Space_58.92_MB_(16.01%)
// #LeetCode_75_LinkedList #Data_Structure_I_Day_8_Linked_List
// #Algorithm_I_Day_10_Recursion_Backtracking #Level_1_Day_3_Linked_List #Udemy_Linked_List
// #Big_O_Time_O(N)_Space_O(1) #2025_03_26_Time_0_ms_(100.00%)_Space_58.92_MB_(16.01%)

import { ListNode } from '../../com_github_leetcode/listnode'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// #Medium #Top_100_Liked_Questions #Top_Interview_Questions #String #Hash_Table #Design #Trie
// #Level_2_Day_16_Design #Udemy_Trie_and_Heap #Top_Interview_150_Trie
// #LeetCode_75_Trie #Level_2_Day_16_Design #Udemy_Trie_and_Heap #Top_Interview_150_Trie
// #Big_O_Time_O(word.length())_or_O(prefix.length())_Space_O(N)
// #2025_03_26_Time_48_ms_(63.95%)_Space_81.97_MB_(12.22%)

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 #Heap_Priority_Queue
// #Divide_and_Conquer #Quickselect #Data_Structure_II_Day_20_Heap_Priority_Queue
// #Top_Interview_150_Heap #Big_O_Time_O(n*log(n))_Space_O(log(n))
// #2025_03_26_Time_4_ms_(99.64%)_Space_66.28_MB_(62.13%)
// #Divide_and_Conquer #Quickselect #LeetCode_75_Heap/Priority_Queue
// #Data_Structure_II_Day_20_Heap_Priority_Queue #Top_Interview_150_Heap
// #Big_O_Time_O(n*log(n))_Space_O(log(n)) #2025_03_26_Time_4_ms_(99.64%)_Space_66.28_MB_(62.13%)

function findKthLargest(nums: number[], k: number): number {
const countingLen = 2e4 + 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// #Medium #Top_100_Liked_Questions #Depth_First_Search #Tree #Binary_Tree
// #Data_Structure_II_Day_18_Tree #Udemy_Tree_Stack_Queue #Top_Interview_150_Binary_Tree_General
// #Big_O_Time_O(n)_Space_O(n) #2025_03_28_Time_61_ms_(75.97%)_Space_65.98_MB_(36.62%)
// #LeetCode_75_Binary_Tree/DFS #Data_Structure_II_Day_18_Tree #Udemy_Tree_Stack_Queue
// #Top_Interview_150_Binary_Tree_General #Big_O_Time_O(n)_Space_O(n)
// #2025_03_28_Time_61_ms_(75.97%)_Space_65.98_MB_(36.62%)

/*
* 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 #Array #Prefix_Sum #Data_Structure_II_Day_5_Array #Udemy_Arrays
// #Top_Interview_150_Array/String #Big_O_Time_O(n^2)_Space_O(n)
// #2025_03_28_Time_3_ms_(92.81%)_Space_70.08_MB_(42.74%)
// #Medium #Top_100_Liked_Questions #Array #Prefix_Sum #LeetCode_75_Array/String
// #Data_Structure_II_Day_5_Array #Udemy_Arrays #Top_Interview_150_Array/String
// #Big_O_Time_O(n^2)_Space_O(n) #2025_03_28_Time_3_ms_(92.81%)_Space_70.08_MB_(42.74%)

function productExceptSelf(nums: number[]): number[] {
const n = nums.length
Expand Down
6 changes: 3 additions & 3 deletions src/main/ts/g0201_0300/s0283_move_zeroes/solution.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// #Easy #Top_100_Liked_Questions #Array #Two_Pointers #Algorithm_I_Day_3_Two_Pointers
// #Programming_Skills_I_Day_6_Array #Udemy_Arrays #Big_O_Time_O(n)_Space_O(1)
// #2025_03_28_Time_1_ms_(82.86%)_Space_62.16_MB_(10.71%)
// #Easy #Top_100_Liked_Questions #Array #Two_Pointers #LeetCode_75_Two_Pointers
// #Algorithm_I_Day_3_Two_Pointers #Programming_Skills_I_Day_6_Array #Udemy_Arrays
// #Big_O_Time_O(n)_Space_O(1) #2025_03_28_Time_1_ms_(82.86%)_Space_62.16_MB_(10.71%)

/*
Do not return anything, modify nums in-place instead.
Expand Down
5 changes: 3 additions & 2 deletions src/main/ts/g0301_0400/s0338_counting_bits/solution.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// #Easy #Dynamic_Programming #Bit_Manipulation #Udemy_Bit_Manipulation
// #Big_O_Time_O(num)_Space_O(num) #2025_03_28_Time_1_ms_(89.22%)_Space_62.26_MB_(53.31%)
// #Easy #Dynamic_Programming #Bit_Manipulation #LeetCode_75_Bit_Manipulation
// #Udemy_Bit_Manipulation #Big_O_Time_O(num)_Space_O(num)
// #2025_03_28_Time_1_ms_(89.22%)_Space_62.26_MB_(53.31%)

function countBits(n: number): number[] {
const bits: number[] = [0]
Expand Down
6 changes: 3 additions & 3 deletions src/main/ts/g0301_0400/s0392_is_subsequence/solution.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// #Easy #String #Dynamic_Programming #Two_Pointers #Dynamic_Programming_I_Day_19
// #Level_1_Day_2_String #Udemy_Two_Pointers #Top_Interview_150_Two_Pointers
// #2025_04_14_Time_0_ms_(100.00%)_Space_56.51_MB_(36.22%)
// #Easy #String #Dynamic_Programming #Two_Pointers #LeetCode_75_Two_Pointers
// #Dynamic_Programming_I_Day_19 #Level_1_Day_2_String #Udemy_Two_Pointers
// #Top_Interview_150_Two_Pointers #2025_04_14_Time_0_ms_(100.00%)_Space_56.51_MB_(36.22%)

function isSubsequence(s: string, t: string): boolean {
let i = 0
Expand Down
5 changes: 3 additions & 2 deletions src/main/ts/g0301_0400/s0394_decode_string/solution.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// #Medium #Top_100_Liked_Questions #String #Stack #Recursion #Level_1_Day_14_Stack #Udemy_Strings
// #Big_O_Time_O(n)_Space_O(n) #2025_03_28_Time_0_ms_(100.00%)_Space_55.70_MB_(34.63%)
// #Medium #Top_100_Liked_Questions #String #Stack #Recursion #LeetCode_75_Stack
// #Level_1_Day_14_Stack #Udemy_Strings #Big_O_Time_O(n)_Space_O(n)
// #2025_03_28_Time_0_ms_(100.00%)_Space_55.70_MB_(34.63%)

function decodeString(s: string): string {
let stack: string[] = []
Expand Down
3 changes: 2 additions & 1 deletion src/main/ts/g0301_0400/s0399_evaluate_division/solution.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// #Medium #Array #Depth_First_Search #Breadth_First_Search #Graph #Union_Find #Shortest_Path
// #Top_Interview_150_Graph_General #2025_04_16_Time_0_ms_(100.00%)_Space_54.98_MB_(77.31%)
// #LeetCode_75_Graphs/DFS #Top_Interview_150_Graph_General
// #2025_04_16_Time_0_ms_(100.00%)_Space_54.98_MB_(77.31%)

type MapType = Map<string, string>
type RateType = Map<string, number>
Expand Down
4 changes: 2 additions & 2 deletions src/main/ts/g0401_0500/s0437_path_sum_iii/solution.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// #Medium #Depth_First_Search #Tree #Binary_Tree #Level_2_Day_7_Tree #Big_O_Time_O(n)_Space_O(n)
// #2025_03_28_Time_3_ms_(86.41%)_Space_61.43_MB_(43.21%)
// #Medium #Depth_First_Search #Tree #Binary_Tree #LeetCode_75_Binary_Tree/DFS #Level_2_Day_7_Tree
// #Big_O_Time_O(n)_Space_O(n) #2025_03_28_Time_3_ms_(86.41%)_Space_61.43_MB_(43.21%)

function pathSum(root: TreeNode | null, targetSum: number): number {
let count = 0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// #Medium #Array #Sorting #Greedy #Top_Interview_150_Intervals
// #Medium #Array #Sorting #Greedy #LeetCode_75_Intervals #Top_Interview_150_Intervals
// #2025_04_15_Time_75_ms_(98.54%)_Space_79.44_MB_(62.20%)

function findMinArrowShots(points: number[][]): number {
Expand Down
5 changes: 3 additions & 2 deletions src/main/ts/g0701_0800/s0739_daily_temperatures/solution.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// #Medium #Top_100_Liked_Questions #Array #Stack #Monotonic_Stack #Programming_Skills_II_Day_6
// #Big_O_Time_O(n)_Space_O(n) #2025_03_28_Time_18_ms_(80.57%)_Space_78.12_MB_(62.08%)
// #Medium #Top_100_Liked_Questions #Array #Stack #Monotonic_Stack #LeetCode_75_Monotonic_Stack
// #Programming_Skills_II_Day_6 #Big_O_Time_O(n)_Space_O(n)
// #2025_03_28_Time_18_ms_(80.57%)_Space_78.12_MB_(62.08%)

function dailyTemperatures(temperatures: number[]): number[] {
let stack: number[] = []
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// #Medium #Array #Dynamic_Programming #Divide_and_Conquer #Queue #Monotonic_Queue
// #Medium #Array #Dynamic_Programming #Divide_and_Conquer #Queue #Monotonic_Queue
// #Dynamic_Programming_I_Day_5 #Top_Interview_150_Kadane's_Algorithm
// #2025_04_15_Time_2_ms_(91.04%)_Space_61.54_MB_(85.07%)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// #Medium #Top_100_Liked_Questions #String #Dynamic_Programming
// #Medium #Top_100_Liked_Questions #String #Dynamic_Programming #LeetCode_75_DP/Multidimensional
// #Algorithm_II_Day_17_Dynamic_Programming #Dynamic_Programming_I_Day_19
// #Udemy_Dynamic_Programming #Big_O_Time_O(n*m)_Space_O(n*m)
// #2025_03_28_Time_50_ms_(69.40%)_Space_85.72_MB_(16.94%)
Expand Down