File tree 10 files changed +32
-34
lines changed
S0011_container_with_most_water
S0034_find_first_and_last_position_of_element_in_sorted_array
S0035_search_insert_position
S0041_first_missing_positive
G0201_0300/S0295_find_median_from_data_stream
10 files changed +32
-34
lines changed Original file line number Diff line number Diff line change @@ -2,14 +2,13 @@ namespace LeetCodeNet.G0001_0100.S0011_container_with_most_water {
2
2
3
3
// #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Array #Greedy #Two_Pointers
4
4
// #Algorithm_II_Day_4_Two_Pointers #Big_O_Time_O(n)_Space_O(1)
5
- // #2023_12_26_Time_248_ms_(11.15%)_Space_62.1_MB_(5.59 %)
5
+ // #2024_01_11_Time_251_ms_(30.70%)_Space_61.5_MB_(26.65 %)
6
6
7
7
public class Solution {
8
8
public int MaxArea ( int [ ] height ) {
9
9
int maxArea = - 1 ;
10
10
int left = 0 ;
11
11
int right = height . Length - 1 ;
12
-
13
12
while ( left < right ) {
14
13
if ( height [ left ] < height [ right ] ) {
15
14
maxArea = Math . Max ( maxArea , height [ left ] * ( right - left ) ) ;
@@ -19,7 +18,6 @@ public int MaxArea(int[] height) {
19
18
right -- ;
20
19
}
21
20
}
22
-
23
21
return maxArea ;
24
22
}
25
23
}
Original file line number Diff line number Diff line change 1
1
namespace LeetCodeNet . G0001_0100 . S0031_next_permutation {
2
2
3
3
// #Medium #Top_100_Liked_Questions #Array #Two_Pointers #Big_O_Time_O(n)_Space_O(1)
4
- // #2023_12_28_Time_202_ms_(5.19%)_Space_46.2_MB_(5.39 %)
4
+ // #2024_01_11_Time_98_ms_(94.17%)_Space_46_MB_(24.35 %)
5
5
6
6
public class Solution {
7
7
public void NextPermutation ( int [ ] nums ) {
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ namespace LeetCodeNet.G0001_0100.S0034_find_first_and_last_position_of_element_i
2
2
3
3
// #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Array #Binary_Search
4
4
// #Algorithm_II_Day_1_Binary_Search #Binary_Search_I_Day_5 #Big_O_Time_O(log_n)_Space_O(1)
5
- // #2023_12_28_Time_171_ms_(5.87 %)_Space_48.4_MB_(5.63 %)
5
+ // #2024_01_11_Time_120_ms_(81.66 %)_Space_48.8_MB_(8.72 %)
6
6
7
7
public class Solution {
8
8
public int [ ] SearchRange ( int [ ] nums , int target ) {
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ namespace LeetCodeNet.G0001_0100.S0035_search_insert_position {
2
2
3
3
// #Easy #Top_100_Liked_Questions #Array #Binary_Search #Algorithm_I_Day_1_Binary_Search
4
4
// #Binary_Search_I_Day_2 #Big_O_Time_O(log_n)_Space_O(1)
5
- // #2023_12_28_Time_106_ms_(6.17%)_Space_42_MB_(5.47 %)
5
+ // #2024_01_11_Time_64_ms_(95.18%)_Space_41.4_MB_(28.65 %)
6
6
7
7
public class Solution {
8
8
public int SearchInsert ( int [ ] nums , int target ) {
Original file line number Diff line number Diff line change 1
1
namespace LeetCodeNet . G0001_0100 . S0041_first_missing_positive {
2
2
3
3
// #Hard #Top_100_Liked_Questions #Top_Interview_Questions #Array #Hash_Table #Udemy_Arrays
4
- // #Big_O_Time_O(n)_Space_O(n) #2023_12_28_Time_192_ms_(13.98 %)_Space_57.8_MB_(13.98 %)
4
+ // #Big_O_Time_O(n)_Space_O(n) #2024_01_11_Time_178_ms_(36.64 %)_Space_57.6_MB_(32.67 %)
5
5
6
6
public class Solution {
7
7
public int FirstMissingPositive ( int [ ] nums ) {
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ namespace LeetCodeNet.G0001_0100.S0045_jump_game_ii {
2
2
3
3
// #Medium #Top_100_Liked_Questions #Array #Dynamic_Programming #Greedy
4
4
// #Algorithm_II_Day_13_Dynamic_Programming #Dynamic_Programming_I_Day_4
5
- // #Big_O_Time_O(n)_Space_O(1) #2023_12_28_Time_144_ms_(15.35%)_Space_44_MB_(16.51 %)
5
+ // #Big_O_Time_O(n)_Space_O(1) #2024_01_11_Time_85_ms_(88.80%)_Space_44.1_MB_(33.81 %)
6
6
7
7
public class Solution {
8
8
public int Jump ( int [ ] nums ) {
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ namespace LeetCodeNet.G0001_0100.S0046_permutations {
3
3
// #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Array #Backtracking
4
4
// #Algorithm_I_Day_11_Recursion_Backtracking #Level_2_Day_20_Brute_Force/Backtracking
5
5
// #Udemy_Backtracking/Recursion #Big_O_Time_O(n*n!)_Space_O(n+n!)
6
- // #2023_12_28_Time_148_ms_(5 .56%)_Space_45.8_MB_(8.50 %)
6
+ // #2024_01_11_Time_96_ms_(96 .56%)_Space_46.4_MB_(12.40 %)
7
7
8
8
using System . Collections . Generic ;
9
9
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ namespace LeetCodeNet.G0001_0100.S0053_maximum_subarray {
3
3
// #Easy #Top_100_Liked_Questions #Top_Interview_Questions #Array #Dynamic_Programming
4
4
// #Divide_and_Conquer #Data_Structure_I_Day_1_Array #Dynamic_Programming_I_Day_5
5
5
// #Udemy_Famous_Algorithm #Big_O_Time_O(n)_Space_O(1)
6
- // #2024_01_04_Time_276_ms_(20.05 %)_Space_62.4_MB_(8.46 %)
6
+ // #2024_01_11_Time_270_ms_(38.35 %)_Space_62.7_MB_(7.88 %)
7
7
8
8
public class Solution {
9
9
public int MaxSubArray ( int [ ] nums ) {
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ namespace LeetCodeNet.G0201_0300.S0295_find_median_from_data_stream {
2
2
3
3
// #Hard #Top_100_Liked_Questions #Top_Interview_Questions #Sorting #Two_Pointers #Design
4
4
// #Heap_Priority_Queue #Data_Stream #Big_O_Time_O(n*log_n)_Space_O(n)
5
- // #2024_01_07_Time_642_ms_(21.62%)_Space_142.7_MB_(6.39 %)
5
+ // #2024_01_11_Time_658_ms_(24.88%)_Space_144_MB_(5.64 %)
6
6
7
7
using System ;
8
8
using System . Collections . Generic ;
Load Diff Large diffs are not rendered by default.
You can’t perform that action at this time.
0 commit comments