File tree Expand file tree Collapse file tree 11 files changed +36
-35
lines changed
s0060_permutation_sequence
s0102_binary_tree_level_order_traversal
s0119_pascals_triangle_ii
s0122_best_time_to_buy_and_sell_stock_ii
s0129_sum_root_to_leaf_numbers
s0168_excel_sheet_column_title
src/main/kotlin/g0301_0400/s0306_additive_number Expand file tree Collapse file tree 11 files changed +36
-35
lines changed Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change 11package g0001_0100.s0060_permutation_sequence
22
3- // #Hard #Math #Recursion #2022_09_22_Time_293_ms_(27.78%)_Space_34.2_MB_(61.11 %)
3+ // #Hard #Math #Recursion #2022_11_25_Time_146_ms_(100.00%)_Space_33.7_MB_(95.45 %)
44
55@Suppress(" NAME_SHADOWING" )
66class Solution {
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ package g0001_0100.s0078_subsets
22
33// #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Array #Bit_Manipulation #Backtracking
44// #Algorithm_II_Day_9_Recursion_Backtracking #Udemy_Backtracking/Recursion
5- // #2022_09_01_Time_353_ms_(30.14 %)_Space_36.4_MB_(91.78 %)
5+ // #2022_11_25_Time_191_ms_(97.44 %)_Space_36.1_MB_(96.15 %)
66
77class Solution {
88 fun subsets (nums : IntArray ): List <List <Int >> {
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ package g0101_0200.s0101_symmetric_tree
22
33// #Easy #Top_100_Liked_Questions #Top_Interview_Questions #Depth_First_Search #Breadth_First_Search
44// #Tree #Binary_Tree #Data_Structure_I_Day_11_Tree #Level_2_Day_15_Tree
5- // #2022_09_02_Time_290_ms_(26.98%)_Space_35.3_MB_(42.52 %)
5+ // #2022_11_25_Time_190_ms_(91.36%)_Space_36.7_MB_(20.94 %)
66
77import com_github_leetcode.TreeNode
88
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ package g0101_0200.s0102_binary_tree_level_order_traversal
22
33// #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Breadth_First_Search #Tree
44// #Binary_Tree #Data_Structure_I_Day_11_Tree #Level_1_Day_6_Tree #Udemy_Tree_Stack_Queue
5- // #2022_09_02_Time_355_ms_(29.37%)_Space_36.7_MB_(63.47 %)
5+ // #2022_11_25_Time_332_ms_(67.53%)_Space_37_MB_(56.24 %)
66
77import com_github_leetcode.TreeNode
88import java.util.ArrayList
Original file line number Diff line number Diff line change 11package g0101_0200.s0119_pascals_triangle_ii
22
33// #Easy #Array #Dynamic_Programming #Data_Structure_II_Day_3_Array #Dynamic_Programming_I_Day_12
4- // #Udemy_Dynamic_Programming #2022_10_08_Time_296_ms_(19.15%)_Space_34.1_MB_(92.20 %)
4+ // #Udemy_Dynamic_Programming #2022_11_25_Time_157_ms_(97.27%)_Space_33.4_MB_(99.09 %)
55
66class Solution {
77 fun getRow (rowIndex : Int ): List <Int > {
Original file line number Diff line number Diff line change 11package g0101_0200.s0122_best_time_to_buy_and_sell_stock_ii
22
33// #Medium #Top_Interview_Questions #Array #Dynamic_Programming #Greedy #Dynamic_Programming_I_Day_7
4- // #Udemy_Arrays #2022_10_08_Time_370_ms_(16.98%)_Space_39.2_MB_(53.51 %)
4+ // #Udemy_Arrays #2022_11_25_Time_197_ms_(95.10%)_Space_35.3_MB_(96.33 %)
55
66class Solution {
77 fun maxProfit (prices : IntArray ): Int {
Original file line number Diff line number Diff line change 11package g0101_0200.s0129_sum_root_to_leaf_numbers
22
33// #Medium #Depth_First_Search #Tree #Binary_Tree
4- // #2022_10_08_Time_269_ms_(29.63%)_Space_33.9_MB_(90.74 %)
4+ // #2022_11_25_Time_237_ms_(52.50%)_Space_34.1_MB_(55.00 %)
55
66import com_github_leetcode.TreeNode
77
@@ -17,6 +17,7 @@ import com_github_leetcode.TreeNode
1717 */
1818class Solution {
1919 private var sum = 0
20+
2021 fun sumNumbers (root : TreeNode ): Int {
2122 recurseSum(root, 0 )
2223 return sum
Original file line number Diff line number Diff line change 11package g0101_0200.s0168_excel_sheet_column_title
22
3- // #Easy #String #Math #2022_10_11_Time_246_ms_(30.12%)_Space_33.6_MB_(75.90 %)
3+ // #Easy #String #Math #2022_11_25_Time_208_ms_(66.07%)_Space_34.2_MB_(39.29 %)
44
55class Solution {
6- fun convertToTitle (n : Int ): String {
7- var num = n
6+ fun convertToTitle (columnNumber : Int ): String {
7+ var num = columnNumber
88 val sb = StringBuilder ()
99 while (num != 0 ) {
1010 var remainder = num % 26
Original file line number Diff line number Diff line change 11# Read from the file file.txt and print its transposed content to stdout.
2- # #Medium #Shell #2022_10_18_Time_477_ms_(28.60 %)_Space_3.9_MB_(33.97 %)
2+ # #Medium #Shell #2022_11_25_Time_461_ms_(33.47 %)_Space_3.9_MB_(34.89 %)
33wordcount=$( head -1 file.txt | wc -w)
44col_n=1
55while [[ $col_n -le $wordcount ]]; do
You can’t perform that action at this time.
0 commit comments