From be60f7790b3ae5d6f12771435e56b5bdc9deb61e Mon Sep 17 00:00:00 2001 From: Valentyn Kolesnikov Date: Mon, 22 Jan 2024 17:00:02 +0200 Subject: [PATCH] Added java and kotlin tasks 6, 7, 8, 9 --- .../s0006_zigzag_conversion/Solution.java | 34 ++++++ .../s0006_zigzag_conversion/readme.md | 39 ++++++ .../s0007_reverse_integer/Solution.java | 17 +++ .../s0007_reverse_integer/readme.md | 35 ++++++ .../Solution.java | 43 +++++++ .../s0008_string_to_integer_atoi/readme.md | 113 ++++++++++++++++++ .../s0009_palindrome_number/Solution.java | 19 +++ .../s0009_palindrome_number/readme.md | 41 +++++++ .../g0001_0100/s0001_two_sum/Solution.kt | 2 +- .../s0002_add_two_numbers/Solution.kt | 2 +- .../Solution.kt | 2 +- .../Solution.kt | 2 +- .../Solution.kt | 2 +- .../s0006_zigzag_conversion/Solution.kt | 34 ++++++ .../s0006_zigzag_conversion/readme.md | 39 ++++++ .../s0007_reverse_integer/Solution.kt | 18 +++ .../s0007_reverse_integer/readme.md | 35 ++++++ .../s0008_string_to_integer_atoi/Solution.kt | 43 +++++++ .../s0008_string_to_integer_atoi/readme.md | 113 ++++++++++++++++++ .../s0009_palindrome_number/Solution.kt | 17 +++ .../s0009_palindrome_number/readme.md | 41 +++++++ .../Solution.kt | 2 +- .../Solution.kt | 2 +- .../kotlin/g0001_0100/s0015_3sum/Solution.kt | 2 +- .../Solution.kt | 2 +- .../Solution.kt | 2 +- .../s0020_valid_parentheses/Solution.kt | 2 +- .../s0021_merge_two_sorted_lists/Solution.kt | 2 +- .../s0022_generate_parentheses/Solution.kt | 2 +- .../s0023_merge_k_sorted_lists/Solution.kt | 2 +- .../s0024_swap_nodes_in_pairs/Solution.kt | 2 +- .../Solution.kt | 2 +- .../s0031_next_permutation/Solution.kt | 2 +- .../Solution.kt | 2 +- .../Solution.kt | 2 +- .../Solution.kt | 2 +- .../s0035_search_insert_position/Solution.kt | 2 +- .../s0039_combination_sum/Solution.kt | 2 +- .../s0041_first_missing_positive/Solution.kt | 2 +- .../s0042_trapping_rain_water/Solution.kt | 2 +- .../g0001_0100/s0045_jump_game_ii/Solution.kt | 2 +- .../g0001_0100/s0046_permutations/Solution.kt | 2 +- .../g0001_0100/s0048_rotate_image/Solution.kt | 2 +- .../s0049_group_anagrams/Solution.kt | 2 +- .../g0001_0100/s0051_n_queens/Solution.kt | 2 +- .../s0053_maximum_subarray/Solution.kt | 2 +- .../g0001_0100/s0055_jump_game/Solution.kt | 2 +- .../s0056_merge_intervals/Solution.kt | 2 +- .../g0001_0100/s0062_unique_paths/Solution.kt | 2 +- .../s0064_minimum_path_sum/Solution.kt | 2 +- .../s0070_climbing_stairs/Solution.kt | 2 +- .../s0072_edit_distance/Solution.kt | 2 +- .../s0073_set_matrix_zeroes/Solution.kt | 2 +- .../s0074_search_a_2d_matrix/Solution.kt | 2 +- .../g0001_0100/s0075_sort_colors/Solution.kt | 2 +- .../Solution.kt | 2 +- .../g0001_0100/s0078_subsets/Solution.kt | 2 +- .../g0001_0100/s0079_word_search/Solution.kt | 2 +- .../Solution.kt | 2 +- .../Solution.kt | 2 +- .../Solution.kt | 2 +- .../Solution.kt | 2 +- .../s0101_symmetric_tree/Solution.kt | 2 +- .../Solution.kt | 2 +- .../Solution.kt | 2 +- .../Solution.kt | 2 +- .../Solution.kt | 2 +- .../Solution.kt | 2 +- .../Solution.kt | 2 +- .../Solution.kt | 2 +- .../s0131_palindrome_partitioning/Solution.kt | 2 +- .../s0136_single_number/Solution.kt | 2 +- .../Solution.kt | 2 +- .../g0101_0200/s0139_word_break/Solution.kt | 2 +- .../s0141_linked_list_cycle/Solution.kt | 2 +- .../s0142_linked_list_cycle_ii/Solution.kt | 2 +- .../g0101_0200/s0146_lru_cache/LRUCache.kt | 2 +- .../g0101_0200/s0148_sort_list/Solution.kt | 2 +- .../Solution.kt | 2 +- .../Solution.kt | 2 +- .../g0101_0200/s0155_min_stack/MinStack.kt | 2 +- .../Solution.kt | 2 +- .../s0169_majority_element/Solution.kt | 2 +- .../g0101_0200/s0189_rotate_array/Solution.kt | 2 +- .../g0101_0200/s0198_house_robber/Solution.kt | 2 +- .../s0200_number_of_islands/Solution.kt | 2 +- .../s0206_reverse_linked_list/Solution.kt | 2 +- .../s0207_course_schedule/Solution.kt | 2 +- .../s0208_implement_trie_prefix_tree/Trie.kt | 2 +- .../Solution.kt | 2 +- .../s0221_maximal_square/Solution.kt | 2 +- .../s0226_invert_binary_tree/Solution.kt | 2 +- .../Solution.kt | 2 +- .../s0234_palindrome_linked_list/Solution.kt | 2 +- .../Solution.kt | 2 +- .../Solution.kt | 2 +- .../s0239_sliding_window_maximum/Solution.kt | 2 +- .../s0240_search_a_2d_matrix_ii/Solution.kt | 2 +- .../g0201_0300/s0283_move_zeroes/Solution.kt | 2 +- .../Solution.kt | 2 +- .../MedianFinder.kt | 2 +- .../Solution.kt | 2 +- .../g0301_0400/s0322_coin_change/Solution.kt | 2 +- .../s0338_counting_bits/Solution.kt | 2 +- .../s0347_top_k_frequent_elements/Solution.kt | 2 +- .../s0394_decode_string/Solution.kt | 2 +- .../Solution.kt | 2 +- .../g0401_0500/s0437_path_sum_iii/Solution.kt | 2 +- .../Solution.kt | 2 +- .../g0401_0500/s0494_target_sum/Solution.kt | 2 +- .../s0543_diameter_of_binary_tree/Solution.kt | 2 +- .../s0560_subarray_sum_equals_k/Solution.kt | 2 +- .../s0647_palindromic_substrings/Solution.kt | 2 +- .../s0739_daily_temperatures/Solution.kt | 2 +- .../s0763_partition_labels/Solution.kt | 2 +- .../Solution.kt | 2 +- 116 files changed, 781 insertions(+), 100 deletions(-) create mode 100644 src/main/java/g0001_0100/s0006_zigzag_conversion/Solution.java create mode 100644 src/main/java/g0001_0100/s0006_zigzag_conversion/readme.md create mode 100644 src/main/java/g0001_0100/s0007_reverse_integer/Solution.java create mode 100644 src/main/java/g0001_0100/s0007_reverse_integer/readme.md create mode 100644 src/main/java/g0001_0100/s0008_string_to_integer_atoi/Solution.java create mode 100644 src/main/java/g0001_0100/s0008_string_to_integer_atoi/readme.md create mode 100644 src/main/java/g0001_0100/s0009_palindrome_number/Solution.java create mode 100644 src/main/java/g0001_0100/s0009_palindrome_number/readme.md create mode 100644 src/main/kotlin/g0001_0100/s0006_zigzag_conversion/Solution.kt create mode 100644 src/main/kotlin/g0001_0100/s0006_zigzag_conversion/readme.md create mode 100644 src/main/kotlin/g0001_0100/s0007_reverse_integer/Solution.kt create mode 100644 src/main/kotlin/g0001_0100/s0007_reverse_integer/readme.md create mode 100644 src/main/kotlin/g0001_0100/s0008_string_to_integer_atoi/Solution.kt create mode 100644 src/main/kotlin/g0001_0100/s0008_string_to_integer_atoi/readme.md create mode 100644 src/main/kotlin/g0001_0100/s0009_palindrome_number/Solution.kt create mode 100644 src/main/kotlin/g0001_0100/s0009_palindrome_number/readme.md diff --git a/src/main/java/g0001_0100/s0006_zigzag_conversion/Solution.java b/src/main/java/g0001_0100/s0006_zigzag_conversion/Solution.java new file mode 100644 index 0000000..cefd41a --- /dev/null +++ b/src/main/java/g0001_0100/s0006_zigzag_conversion/Solution.java @@ -0,0 +1,34 @@ +package g0001_0100.s0006_zigzag_conversion; + +// #Medium #String + +public class Solution { + public String convert(String s, int numRows) { + int sLen = s.length(); + if (numRows == 1) { + return s; + } + int maxDist = numRows * 2 - 2; + StringBuilder buf = new StringBuilder(); + for (int i = 0; i < numRows; i++) { + int index = i; + if (i == 0 || i == numRows - 1) { + while (index < sLen) { + buf.append(s.charAt(index)); + index += maxDist; + } + } else { + while (index < sLen) { + buf.append(s.charAt(index)); + index += maxDist - i * 2; + if (index >= sLen) { + break; + } + buf.append(s.charAt(index)); + index += i * 2; + } + } + } + return buf.toString(); + } +} diff --git a/src/main/java/g0001_0100/s0006_zigzag_conversion/readme.md b/src/main/java/g0001_0100/s0006_zigzag_conversion/readme.md new file mode 100644 index 0000000..4f55d57 --- /dev/null +++ b/src/main/java/g0001_0100/s0006_zigzag_conversion/readme.md @@ -0,0 +1,39 @@ +6\. Zigzag Conversion + +Medium + +The string `"PAYPALISHIRING"` is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility) + +P A H N A P L S I I G Y I R + +And then read line by line: `"PAHNAPLSIIGYIR"` + +Write the code that will take a string and make this conversion given a number of rows: + +string convert(string s, int numRows); + +**Example 1:** + +**Input:** s = "PAYPALISHIRING", numRows = 3 + +**Output:** "PAHNAPLSIIGYIR" + +**Example 2:** + +**Input:** s = "PAYPALISHIRING", numRows = 4 + +**Output:** "PINALSIGYAHRPI" + +**Explanation:** P I N A L S I G Y A H R P I + +**Example 3:** + +**Input:** s = "A", numRows = 1 + +**Output:** "A" + +**Constraints:** + +* `1 <= s.length <= 1000` +* `s` consists of English letters (lower-case and upper-case), `','` and `'.'`. +* `1 <= numRows <= 1000` \ No newline at end of file diff --git a/src/main/java/g0001_0100/s0007_reverse_integer/Solution.java b/src/main/java/g0001_0100/s0007_reverse_integer/Solution.java new file mode 100644 index 0000000..cb1d27e --- /dev/null +++ b/src/main/java/g0001_0100/s0007_reverse_integer/Solution.java @@ -0,0 +1,17 @@ +package g0001_0100.s0007_reverse_integer; + +// #Medium #Top_Interview_Questions #Math #Udemy_Integers + +public class Solution { + public int reverse(int x) { + long rev = 0; + while (x != 0) { + rev = (rev * 10) + (x % 10); + x /= 10; + } + if (rev > Integer.MAX_VALUE || rev < Integer.MIN_VALUE) { + return 0; + } + return (int) rev; + } +} diff --git a/src/main/java/g0001_0100/s0007_reverse_integer/readme.md b/src/main/java/g0001_0100/s0007_reverse_integer/readme.md new file mode 100644 index 0000000..81dbb62 --- /dev/null +++ b/src/main/java/g0001_0100/s0007_reverse_integer/readme.md @@ -0,0 +1,35 @@ +7\. Reverse Integer + +Medium + +Given a signed 32-bit integer `x`, return `x` _with its digits reversed_. If reversing `x` causes the value to go outside the signed 32-bit integer range [-231, 231 - 1], then return `0`. + +**Assume the environment does not allow you to store 64-bit integers (signed or unsigned).** + +**Example 1:** + +**Input:** x = 123 + +**Output:** 321 + +**Example 2:** + +**Input:** x = -123 + +**Output:** -321 + +**Example 3:** + +**Input:** x = 120 + +**Output:** 21 + +**Example 4:** + +**Input:** x = 0 + +**Output:** 0 + +**Constraints:** + +* -231 <= x <= 231 - 1 \ No newline at end of file diff --git a/src/main/java/g0001_0100/s0008_string_to_integer_atoi/Solution.java b/src/main/java/g0001_0100/s0008_string_to_integer_atoi/Solution.java new file mode 100644 index 0000000..d3a2582 --- /dev/null +++ b/src/main/java/g0001_0100/s0008_string_to_integer_atoi/Solution.java @@ -0,0 +1,43 @@ +package g0001_0100.s0008_string_to_integer_atoi; + +// #Medium #Top_Interview_Questions #String + +public class Solution { + public int myAtoi(String str) { + if (str == null || str.length() == 0) { + return 0; + } + int i = 0; + boolean negetiveSign = false; + char[] input = str.toCharArray(); + while (i < input.length && input[i] == ' ') { + i++; + } + if (i == input.length) { + return 0; + } else if (input[i] == '+') { + i++; + } else if (input[i] == '-') { + i++; + negetiveSign = true; + } + int num = 0; + while (i < input.length && input[i] <= '9' && input[i] >= '0') { + // current char + int tem = input[i] - '0'; + tem = negetiveSign ? -tem : tem; + // avoid invalid number like 038 + if (num == 0 && tem == '0') { + i++; + } else if (num == Integer.MIN_VALUE / 10 && tem <= -8 || num < Integer.MIN_VALUE / 10) { + return Integer.MIN_VALUE; + } else if (num == Integer.MAX_VALUE / 10 && tem >= 7 || num > Integer.MAX_VALUE / 10) { + return Integer.MAX_VALUE; + } else { + num = num * 10 + tem; + i++; + } + } + return num; + } +} diff --git a/src/main/java/g0001_0100/s0008_string_to_integer_atoi/readme.md b/src/main/java/g0001_0100/s0008_string_to_integer_atoi/readme.md new file mode 100644 index 0000000..af67f64 --- /dev/null +++ b/src/main/java/g0001_0100/s0008_string_to_integer_atoi/readme.md @@ -0,0 +1,113 @@ +8\. String to Integer (atoi) + +Medium + +Implement the `myAtoi(string s)` function, which converts a string to a 32-bit signed integer (similar to C/C++'s `atoi` function). + +The algorithm for `myAtoi(string s)` is as follows: + +1. Read in and ignore any leading whitespace. +2. Check if the next character (if not already at the end of the string) is `'-'` or `'+'`. Read this character in if it is either. This determines if the final result is negative or positive respectively. Assume the result is positive if neither is present. +3. Read in next the characters until the next non-digit character or the end of the input is reached. The rest of the string is ignored. +4. Convert these digits into an integer (i.e. `"123" -> 123`, `"0032" -> 32`). If no digits were read, then the integer is `0`. Change the sign as necessary (from step 2). +5. If the integer is out of the 32-bit signed integer range [-231, 231 - 1], then clamp the integer so that it remains in the range. Specifically, integers less than -231 should be clamped to -231, and integers greater than 231 - 1 should be clamped to 231 - 1. +6. Return the integer as the final result. + +**Note:** + +* Only the space character `' '` is considered a whitespace character. +* **Do not ignore** any characters other than the leading whitespace or the rest of the string after the digits. + +**Example 1:** + +**Input:** s = "42" + +**Output:** 42 + +**Explanation:** The underlined characters are what is read in, the caret is the current reader position. + + Step 1: "42" (no characters read because there is no leading whitespace) + ^ + Step 2: "42" (no characters read because there is neither a '-' nor '+') + ^ + Step 3: "42" ("42" is read in) + ^ + +The parsed integer is 42. Since 42 is in the range [-231, 231 - 1], the final result is 42. + +**Example 2:** + +**Input:** s = " -42" + +**Output:** -42 + +**Explanation:** + + Step 1: " -42" (leading whitespace is read and ignored) + ^ + Step 2: " -42" ('-' is read, so the result should be negative) + ^ + Step 3: " -42" ("42" is read in) + ^ + The parsed integer is -42. + +Since -42 is in the range [-231, 231 - 1], the final result is -42. + +**Example 3:** + +**Input:** s = "4193 with words" + +**Output:** 4193 + +**Explanation:** + + Step 1: "4193 with words" (no characters read because there is no leading whitespace) + ^ + Step 2: "4193 with words" (no characters read because there is neither a '-' nor '+') + ^ + Step 3: "4193 with words" ("4193" is read in; reading stops because the next character is a non-digit) + ^ + The parsed integer is 4193. + +Since 4193 is in the range [-231, 231 - 1], the final result is 4193. + +**Example 4:** + +**Input:** s = "words and 987" + +**Output:** 0 + +**Explanation:** + + Step 1: "words and 987" (no characters read because there is no leading whitespace) + ^ + Step 2: "words and 987" (no characters read because there is neither a '-' nor '+') + ^ + Step 3: "words and 987" (reading stops immediately because there is a non-digit 'w') + ^ + The parsed integer is 0 because no digits were read. + +Since 0 is in the range [-231, 231 - 1], the final result is 0. + +**Example 5:** + +**Input:** s = "-91283472332" + +**Output:** -2147483648 + +**Explanation:** + + Step 1: "-91283472332" (no characters read because there is no leading whitespace) + ^ + Step 2: "-91283472332" ('-' is read, so the result should be negative) + ^ + Step 3: "-91283472332" ("91283472332" is read in) + ^ + The parsed integer is -91283472332. + +Since -91283472332 is less than the lower bound of the range [-231, 231 - 1], the final result is clamped to -231 = -2147483648. + +**Constraints:** + +* `0 <= s.length <= 200` +* `s` consists of English letters (lower-case and upper-case), digits (`0-9`), `' '`, `'+'`, `'-'`, and `'.'`. \ No newline at end of file diff --git a/src/main/java/g0001_0100/s0009_palindrome_number/Solution.java b/src/main/java/g0001_0100/s0009_palindrome_number/Solution.java new file mode 100644 index 0000000..9dcc963 --- /dev/null +++ b/src/main/java/g0001_0100/s0009_palindrome_number/Solution.java @@ -0,0 +1,19 @@ +package g0001_0100.s0009_palindrome_number; + +// #Easy #Math #Udemy_Integers + +public class Solution { + public boolean isPalindrome(int x) { + if (x < 0) { + return false; + } + int rev = 0; + int localX = x; + while (localX > 0) { + rev *= 10; + rev += localX % 10; + localX /= 10; + } + return rev == x; + } +} diff --git a/src/main/java/g0001_0100/s0009_palindrome_number/readme.md b/src/main/java/g0001_0100/s0009_palindrome_number/readme.md new file mode 100644 index 0000000..f05939b --- /dev/null +++ b/src/main/java/g0001_0100/s0009_palindrome_number/readme.md @@ -0,0 +1,41 @@ +9\. Palindrome Number + +Easy + +Given an integer `x`, return `true` if `x` is palindrome integer. + +An integer is a **palindrome** when it reads the same backward as forward. For example, `121` is palindrome while `123` is not. + +**Example 1:** + +**Input:** x = 121 + +**Output:** true + +**Example 2:** + +**Input:** x = -121 + +**Output:** false + +**Explanation:** From left to right, it reads -121. From right to left, it becomes 121-. Therefore it is not a palindrome. + +**Example 3:** + +**Input:** x = 10 + +**Output:** false + +**Explanation:** Reads 01 from right to left. Therefore it is not a palindrome. + +**Example 4:** + +**Input:** x = -101 + +**Output:** false + +**Constraints:** + +* -231 <= x <= 231 - 1 + +**Follow up:** Could you solve it without converting the integer to a string? \ No newline at end of file diff --git a/src/main/kotlin/g0001_0100/s0001_two_sum/Solution.kt b/src/main/kotlin/g0001_0100/s0001_two_sum/Solution.kt index 2d1fc55..84b3839 100644 --- a/src/main/kotlin/g0001_0100/s0001_two_sum/Solution.kt +++ b/src/main/kotlin/g0001_0100/s0001_two_sum/Solution.kt @@ -1,4 +1,4 @@ -package g0001_0100.s0001_two_sum; +package g0001_0100.s0001_two_sum // #Easy #Top_100_Liked_Questions #Top_Interview_Questions #Array #Hash_Table // #Data_Structure_I_Day_2_Array #Level_1_Day_13_Hashmap #Udemy_Arrays #Big_O_Time_O(n)_Space_O(n) diff --git a/src/main/kotlin/g0001_0100/s0002_add_two_numbers/Solution.kt b/src/main/kotlin/g0001_0100/s0002_add_two_numbers/Solution.kt index 83b7d20..38b6727 100644 --- a/src/main/kotlin/g0001_0100/s0002_add_two_numbers/Solution.kt +++ b/src/main/kotlin/g0001_0100/s0002_add_two_numbers/Solution.kt @@ -1,4 +1,4 @@ -package g0001_0100.s0002_add_two_numbers; +package g0001_0100.s0002_add_two_numbers // #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Math #Linked_List #Recursion // #Data_Structure_II_Day_10_Linked_List #Programming_Skills_II_Day_15 diff --git a/src/main/kotlin/g0001_0100/s0003_longest_substring_without_repeating_characters/Solution.kt b/src/main/kotlin/g0001_0100/s0003_longest_substring_without_repeating_characters/Solution.kt index 11520b2..b893783 100644 --- a/src/main/kotlin/g0001_0100/s0003_longest_substring_without_repeating_characters/Solution.kt +++ b/src/main/kotlin/g0001_0100/s0003_longest_substring_without_repeating_characters/Solution.kt @@ -1,4 +1,4 @@ -package g0001_0100.s0003_longest_substring_without_repeating_characters; +package g0001_0100.s0003_longest_substring_without_repeating_characters // #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 diff --git a/src/main/kotlin/g0001_0100/s0004_median_of_two_sorted_arrays/Solution.kt b/src/main/kotlin/g0001_0100/s0004_median_of_two_sorted_arrays/Solution.kt index f4a1aca..1b84313 100644 --- a/src/main/kotlin/g0001_0100/s0004_median_of_two_sorted_arrays/Solution.kt +++ b/src/main/kotlin/g0001_0100/s0004_median_of_two_sorted_arrays/Solution.kt @@ -1,4 +1,4 @@ -package g0001_0100.s0004_median_of_two_sorted_arrays; +package g0001_0100.s0004_median_of_two_sorted_arrays // #Hard #Top_100_Liked_Questions #Top_Interview_Questions #Array #Binary_Search #Divide_and_Conquer // #Big_O_Time_O(log(min(N,M)))_Space_O(1) diff --git a/src/main/kotlin/g0001_0100/s0005_longest_palindromic_substring/Solution.kt b/src/main/kotlin/g0001_0100/s0005_longest_palindromic_substring/Solution.kt index e2905a5..d1c09b5 100644 --- a/src/main/kotlin/g0001_0100/s0005_longest_palindromic_substring/Solution.kt +++ b/src/main/kotlin/g0001_0100/s0005_longest_palindromic_substring/Solution.kt @@ -1,4 +1,4 @@ -package g0001_0100.s0005_longest_palindromic_substring; +package g0001_0100.s0005_longest_palindromic_substring // #Medium #Top_100_Liked_Questions #Top_Interview_Questions #String #Dynamic_Programming // #Data_Structure_II_Day_9_String #Algorithm_II_Day_14_Dynamic_Programming diff --git a/src/main/kotlin/g0001_0100/s0006_zigzag_conversion/Solution.kt b/src/main/kotlin/g0001_0100/s0006_zigzag_conversion/Solution.kt new file mode 100644 index 0000000..7d93541 --- /dev/null +++ b/src/main/kotlin/g0001_0100/s0006_zigzag_conversion/Solution.kt @@ -0,0 +1,34 @@ +package g0001_0100.s0006_zigzag_conversion + +// #Medium #String + +class Solution { + fun convert(s: String, numRows: Int): String { + val sLen = s.length + if (numRows == 1) { + return s + } + val maxDist = numRows * 2 - 2 + val buf = StringBuilder() + for (i in 0 until numRows) { + var index = i + if (i == 0 || i == numRows - 1) { + while (index < sLen) { + buf.append(s[index]) + index += maxDist + } + } else { + while (index < sLen) { + buf.append(s[index]) + index += maxDist - i * 2 + if (index >= sLen) { + break + } + buf.append(s[index]) + index += i * 2 + } + } + } + return buf.toString() + } +} diff --git a/src/main/kotlin/g0001_0100/s0006_zigzag_conversion/readme.md b/src/main/kotlin/g0001_0100/s0006_zigzag_conversion/readme.md new file mode 100644 index 0000000..4f55d57 --- /dev/null +++ b/src/main/kotlin/g0001_0100/s0006_zigzag_conversion/readme.md @@ -0,0 +1,39 @@ +6\. Zigzag Conversion + +Medium + +The string `"PAYPALISHIRING"` is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility) + +P A H N A P L S I I G Y I R + +And then read line by line: `"PAHNAPLSIIGYIR"` + +Write the code that will take a string and make this conversion given a number of rows: + +string convert(string s, int numRows); + +**Example 1:** + +**Input:** s = "PAYPALISHIRING", numRows = 3 + +**Output:** "PAHNAPLSIIGYIR" + +**Example 2:** + +**Input:** s = "PAYPALISHIRING", numRows = 4 + +**Output:** "PINALSIGYAHRPI" + +**Explanation:** P I N A L S I G Y A H R P I + +**Example 3:** + +**Input:** s = "A", numRows = 1 + +**Output:** "A" + +**Constraints:** + +* `1 <= s.length <= 1000` +* `s` consists of English letters (lower-case and upper-case), `','` and `'.'`. +* `1 <= numRows <= 1000` \ No newline at end of file diff --git a/src/main/kotlin/g0001_0100/s0007_reverse_integer/Solution.kt b/src/main/kotlin/g0001_0100/s0007_reverse_integer/Solution.kt new file mode 100644 index 0000000..e1fb082 --- /dev/null +++ b/src/main/kotlin/g0001_0100/s0007_reverse_integer/Solution.kt @@ -0,0 +1,18 @@ +package g0001_0100.s0007_reverse_integer + +// #Medium #Top_Interview_Questions #Math #Udemy_Integers + +class Solution { + fun reverse(x: Int): Int { + var rev: Long = 0 + var localX = x + while (localX != 0) { + rev = (rev * 10) + (localX % 10) + localX /= 10 + } + if (rev > Integer.MAX_VALUE || rev < Integer.MIN_VALUE) { + return 0 + } + return rev.toInt() + } +} diff --git a/src/main/kotlin/g0001_0100/s0007_reverse_integer/readme.md b/src/main/kotlin/g0001_0100/s0007_reverse_integer/readme.md new file mode 100644 index 0000000..81dbb62 --- /dev/null +++ b/src/main/kotlin/g0001_0100/s0007_reverse_integer/readme.md @@ -0,0 +1,35 @@ +7\. Reverse Integer + +Medium + +Given a signed 32-bit integer `x`, return `x` _with its digits reversed_. If reversing `x` causes the value to go outside the signed 32-bit integer range [-231, 231 - 1], then return `0`. + +**Assume the environment does not allow you to store 64-bit integers (signed or unsigned).** + +**Example 1:** + +**Input:** x = 123 + +**Output:** 321 + +**Example 2:** + +**Input:** x = -123 + +**Output:** -321 + +**Example 3:** + +**Input:** x = 120 + +**Output:** 21 + +**Example 4:** + +**Input:** x = 0 + +**Output:** 0 + +**Constraints:** + +* -231 <= x <= 231 - 1 \ No newline at end of file diff --git a/src/main/kotlin/g0001_0100/s0008_string_to_integer_atoi/Solution.kt b/src/main/kotlin/g0001_0100/s0008_string_to_integer_atoi/Solution.kt new file mode 100644 index 0000000..21fdf07 --- /dev/null +++ b/src/main/kotlin/g0001_0100/s0008_string_to_integer_atoi/Solution.kt @@ -0,0 +1,43 @@ +package g0001_0100.s0008_string_to_integer_atoi + +// #Medium #Top_Interview_Questions #String + +class Solution { + fun myAtoi(str: String): Int { + if (str.isEmpty()) { + return 0 + } + var i = 0 + var negativeSign = false + val input = str.toCharArray() + while (i < input.size && input[i] == ' ') { + i++ + } + if (i == input.size) { + return 0 + } else if (input[i] == '+') { + i++ + } else if (input[i] == '-') { + i++ + negativeSign = true + } + var num = 0 + while (i < input.size && input[i] <= '9' && input[i] >= '0') { + // current char + var tem = input[i] - '0' + tem = if (negativeSign) -tem else tem + // avoid invalid number like 038 + if (num == 0 && tem == '0'.code) { + i++ + } else if (num == Int.MIN_VALUE / 10 && tem <= -8 || num < Int.MIN_VALUE / 10) { + return Int.MIN_VALUE + } else if (num == Int.MAX_VALUE / 10 && tem >= 7 || num > Int.MAX_VALUE / 10) { + return Int.MAX_VALUE + } else { + num = num * 10 + tem + i++ + } + } + return num + } +} diff --git a/src/main/kotlin/g0001_0100/s0008_string_to_integer_atoi/readme.md b/src/main/kotlin/g0001_0100/s0008_string_to_integer_atoi/readme.md new file mode 100644 index 0000000..af67f64 --- /dev/null +++ b/src/main/kotlin/g0001_0100/s0008_string_to_integer_atoi/readme.md @@ -0,0 +1,113 @@ +8\. String to Integer (atoi) + +Medium + +Implement the `myAtoi(string s)` function, which converts a string to a 32-bit signed integer (similar to C/C++'s `atoi` function). + +The algorithm for `myAtoi(string s)` is as follows: + +1. Read in and ignore any leading whitespace. +2. Check if the next character (if not already at the end of the string) is `'-'` or `'+'`. Read this character in if it is either. This determines if the final result is negative or positive respectively. Assume the result is positive if neither is present. +3. Read in next the characters until the next non-digit character or the end of the input is reached. The rest of the string is ignored. +4. Convert these digits into an integer (i.e. `"123" -> 123`, `"0032" -> 32`). If no digits were read, then the integer is `0`. Change the sign as necessary (from step 2). +5. If the integer is out of the 32-bit signed integer range [-231, 231 - 1], then clamp the integer so that it remains in the range. Specifically, integers less than -231 should be clamped to -231, and integers greater than 231 - 1 should be clamped to 231 - 1. +6. Return the integer as the final result. + +**Note:** + +* Only the space character `' '` is considered a whitespace character. +* **Do not ignore** any characters other than the leading whitespace or the rest of the string after the digits. + +**Example 1:** + +**Input:** s = "42" + +**Output:** 42 + +**Explanation:** The underlined characters are what is read in, the caret is the current reader position. + + Step 1: "42" (no characters read because there is no leading whitespace) + ^ + Step 2: "42" (no characters read because there is neither a '-' nor '+') + ^ + Step 3: "42" ("42" is read in) + ^ + +The parsed integer is 42. Since 42 is in the range [-231, 231 - 1], the final result is 42. + +**Example 2:** + +**Input:** s = " -42" + +**Output:** -42 + +**Explanation:** + + Step 1: " -42" (leading whitespace is read and ignored) + ^ + Step 2: " -42" ('-' is read, so the result should be negative) + ^ + Step 3: " -42" ("42" is read in) + ^ + The parsed integer is -42. + +Since -42 is in the range [-231, 231 - 1], the final result is -42. + +**Example 3:** + +**Input:** s = "4193 with words" + +**Output:** 4193 + +**Explanation:** + + Step 1: "4193 with words" (no characters read because there is no leading whitespace) + ^ + Step 2: "4193 with words" (no characters read because there is neither a '-' nor '+') + ^ + Step 3: "4193 with words" ("4193" is read in; reading stops because the next character is a non-digit) + ^ + The parsed integer is 4193. + +Since 4193 is in the range [-231, 231 - 1], the final result is 4193. + +**Example 4:** + +**Input:** s = "words and 987" + +**Output:** 0 + +**Explanation:** + + Step 1: "words and 987" (no characters read because there is no leading whitespace) + ^ + Step 2: "words and 987" (no characters read because there is neither a '-' nor '+') + ^ + Step 3: "words and 987" (reading stops immediately because there is a non-digit 'w') + ^ + The parsed integer is 0 because no digits were read. + +Since 0 is in the range [-231, 231 - 1], the final result is 0. + +**Example 5:** + +**Input:** s = "-91283472332" + +**Output:** -2147483648 + +**Explanation:** + + Step 1: "-91283472332" (no characters read because there is no leading whitespace) + ^ + Step 2: "-91283472332" ('-' is read, so the result should be negative) + ^ + Step 3: "-91283472332" ("91283472332" is read in) + ^ + The parsed integer is -91283472332. + +Since -91283472332 is less than the lower bound of the range [-231, 231 - 1], the final result is clamped to -231 = -2147483648. + +**Constraints:** + +* `0 <= s.length <= 200` +* `s` consists of English letters (lower-case and upper-case), digits (`0-9`), `' '`, `'+'`, `'-'`, and `'.'`. \ No newline at end of file diff --git a/src/main/kotlin/g0001_0100/s0009_palindrome_number/Solution.kt b/src/main/kotlin/g0001_0100/s0009_palindrome_number/Solution.kt new file mode 100644 index 0000000..4f6f0c9 --- /dev/null +++ b/src/main/kotlin/g0001_0100/s0009_palindrome_number/Solution.kt @@ -0,0 +1,17 @@ +package g0001_0100.s0009_palindrome_number + +// #Easy #Math #Udemy_Integers + +class Solution { + fun isPalindrome(x: Int): Boolean { + if (x < 0) return false + var rev = 0 + var localX = x + while (localX > 0) { + rev *= 10 + rev += localX % 10 + localX /= 10 + } + return rev == x + } +} diff --git a/src/main/kotlin/g0001_0100/s0009_palindrome_number/readme.md b/src/main/kotlin/g0001_0100/s0009_palindrome_number/readme.md new file mode 100644 index 0000000..f05939b --- /dev/null +++ b/src/main/kotlin/g0001_0100/s0009_palindrome_number/readme.md @@ -0,0 +1,41 @@ +9\. Palindrome Number + +Easy + +Given an integer `x`, return `true` if `x` is palindrome integer. + +An integer is a **palindrome** when it reads the same backward as forward. For example, `121` is palindrome while `123` is not. + +**Example 1:** + +**Input:** x = 121 + +**Output:** true + +**Example 2:** + +**Input:** x = -121 + +**Output:** false + +**Explanation:** From left to right, it reads -121. From right to left, it becomes 121-. Therefore it is not a palindrome. + +**Example 3:** + +**Input:** x = 10 + +**Output:** false + +**Explanation:** Reads 01 from right to left. Therefore it is not a palindrome. + +**Example 4:** + +**Input:** x = -101 + +**Output:** false + +**Constraints:** + +* -231 <= x <= 231 - 1 + +**Follow up:** Could you solve it without converting the integer to a string? \ No newline at end of file diff --git a/src/main/kotlin/g0001_0100/s0010_regular_expression_matching/Solution.kt b/src/main/kotlin/g0001_0100/s0010_regular_expression_matching/Solution.kt index 28405c5..d233920 100644 --- a/src/main/kotlin/g0001_0100/s0010_regular_expression_matching/Solution.kt +++ b/src/main/kotlin/g0001_0100/s0010_regular_expression_matching/Solution.kt @@ -1,4 +1,4 @@ -package g0001_0100.s0010_regular_expression_matching; +package g0001_0100.s0010_regular_expression_matching // #Hard #Top_100_Liked_Questions #Top_Interview_Questions #String #Dynamic_Programming #Recursion // #Udemy_Dynamic_Programming #Big_O_Time_O(m*n)_Space_O(m*n) diff --git a/src/main/kotlin/g0001_0100/s0011_container_with_most_water/Solution.kt b/src/main/kotlin/g0001_0100/s0011_container_with_most_water/Solution.kt index 5a6f097..197824a 100644 --- a/src/main/kotlin/g0001_0100/s0011_container_with_most_water/Solution.kt +++ b/src/main/kotlin/g0001_0100/s0011_container_with_most_water/Solution.kt @@ -1,4 +1,4 @@ -package g0001_0100.s0011_container_with_most_water; +package g0001_0100.s0011_container_with_most_water // #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Array #Greedy #Two_Pointers // #Algorithm_II_Day_4_Two_Pointers #Big_O_Time_O(n)_Space_O(1) diff --git a/src/main/kotlin/g0001_0100/s0015_3sum/Solution.kt b/src/main/kotlin/g0001_0100/s0015_3sum/Solution.kt index ec57121..87ded3f 100644 --- a/src/main/kotlin/g0001_0100/s0015_3sum/Solution.kt +++ b/src/main/kotlin/g0001_0100/s0015_3sum/Solution.kt @@ -1,4 +1,4 @@ -package g0001_0100.s0015_3sum; +package g0001_0100.s0015_3sum // #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 diff --git a/src/main/kotlin/g0001_0100/s0017_letter_combinations_of_a_phone_number/Solution.kt b/src/main/kotlin/g0001_0100/s0017_letter_combinations_of_a_phone_number/Solution.kt index 0790f3f..c3fb180 100644 --- a/src/main/kotlin/g0001_0100/s0017_letter_combinations_of_a_phone_number/Solution.kt +++ b/src/main/kotlin/g0001_0100/s0017_letter_combinations_of_a_phone_number/Solution.kt @@ -1,4 +1,4 @@ -package g0001_0100.s0017_letter_combinations_of_a_phone_number; +package g0001_0100.s0017_letter_combinations_of_a_phone_number // #Medium #Top_100_Liked_Questions #Top_Interview_Questions #String #Hash_Table #Backtracking // #Algorithm_II_Day_11_Recursion_Backtracking #Udemy_Backtracking/Recursion diff --git a/src/main/kotlin/g0001_0100/s0019_remove_nth_node_from_end_of_list/Solution.kt b/src/main/kotlin/g0001_0100/s0019_remove_nth_node_from_end_of_list/Solution.kt index 52b0dbb..1ec40f7 100644 --- a/src/main/kotlin/g0001_0100/s0019_remove_nth_node_from_end_of_list/Solution.kt +++ b/src/main/kotlin/g0001_0100/s0019_remove_nth_node_from_end_of_list/Solution.kt @@ -1,4 +1,4 @@ -package g0001_0100.s0019_remove_nth_node_from_end_of_list; +package g0001_0100.s0019_remove_nth_node_from_end_of_list // #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Two_Pointers #Linked_List // #Algorithm_I_Day_5_Two_Pointers #Level_2_Day_3_Linked_List #Big_O_Time_O(L)_Space_O(L) diff --git a/src/main/kotlin/g0001_0100/s0020_valid_parentheses/Solution.kt b/src/main/kotlin/g0001_0100/s0020_valid_parentheses/Solution.kt index 0bad0a8..b3f1640 100644 --- a/src/main/kotlin/g0001_0100/s0020_valid_parentheses/Solution.kt +++ b/src/main/kotlin/g0001_0100/s0020_valid_parentheses/Solution.kt @@ -1,4 +1,4 @@ -package g0001_0100.s0020_valid_parentheses; +package g0001_0100.s0020_valid_parentheses // #Easy #Top_100_Liked_Questions #Top_Interview_Questions #String #Stack // #Data_Structure_I_Day_9_Stack_Queue #Udemy_Strings #Big_O_Time_O(n)_Space_O(n) diff --git a/src/main/kotlin/g0001_0100/s0021_merge_two_sorted_lists/Solution.kt b/src/main/kotlin/g0001_0100/s0021_merge_two_sorted_lists/Solution.kt index c0ae159..f0cf890 100644 --- a/src/main/kotlin/g0001_0100/s0021_merge_two_sorted_lists/Solution.kt +++ b/src/main/kotlin/g0001_0100/s0021_merge_two_sorted_lists/Solution.kt @@ -1,4 +1,4 @@ -package g0001_0100.s0021_merge_two_sorted_lists; +package g0001_0100.s0021_merge_two_sorted_lists // #Easy #Top_100_Liked_Questions #Top_Interview_Questions #Linked_List #Recursion // #Data_Structure_I_Day_7_Linked_List #Algorithm_I_Day_10_Recursion_Backtracking diff --git a/src/main/kotlin/g0001_0100/s0022_generate_parentheses/Solution.kt b/src/main/kotlin/g0001_0100/s0022_generate_parentheses/Solution.kt index 5fd90aa..de3e599 100644 --- a/src/main/kotlin/g0001_0100/s0022_generate_parentheses/Solution.kt +++ b/src/main/kotlin/g0001_0100/s0022_generate_parentheses/Solution.kt @@ -1,4 +1,4 @@ -package g0001_0100.s0022_generate_parentheses; +package g0001_0100.s0022_generate_parentheses // #Medium #Top_100_Liked_Questions #Top_Interview_Questions #String #Dynamic_Programming // #Backtracking #Algorithm_II_Day_11_Recursion_Backtracking #Udemy_Backtracking/Recursion diff --git a/src/main/kotlin/g0001_0100/s0023_merge_k_sorted_lists/Solution.kt b/src/main/kotlin/g0001_0100/s0023_merge_k_sorted_lists/Solution.kt index 55451c3..3ea7d44 100644 --- a/src/main/kotlin/g0001_0100/s0023_merge_k_sorted_lists/Solution.kt +++ b/src/main/kotlin/g0001_0100/s0023_merge_k_sorted_lists/Solution.kt @@ -1,4 +1,4 @@ -package g0001_0100.s0023_merge_k_sorted_lists; +package g0001_0100.s0023_merge_k_sorted_lists // #Hard #Top_100_Liked_Questions #Top_Interview_Questions #Heap_Priority_Queue #Linked_List // #Divide_and_Conquer #Merge_Sort #Big_O_Time_O(k*n*log(k))_Space_O(log(k)) diff --git a/src/main/kotlin/g0001_0100/s0024_swap_nodes_in_pairs/Solution.kt b/src/main/kotlin/g0001_0100/s0024_swap_nodes_in_pairs/Solution.kt index eb3dff2..6332786 100644 --- a/src/main/kotlin/g0001_0100/s0024_swap_nodes_in_pairs/Solution.kt +++ b/src/main/kotlin/g0001_0100/s0024_swap_nodes_in_pairs/Solution.kt @@ -1,4 +1,4 @@ -package g0001_0100.s0024_swap_nodes_in_pairs; +package g0001_0100.s0024_swap_nodes_in_pairs // #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) diff --git a/src/main/kotlin/g0001_0100/s0025_reverse_nodes_in_k_group/Solution.kt b/src/main/kotlin/g0001_0100/s0025_reverse_nodes_in_k_group/Solution.kt index c4eae41..d15693c 100644 --- a/src/main/kotlin/g0001_0100/s0025_reverse_nodes_in_k_group/Solution.kt +++ b/src/main/kotlin/g0001_0100/s0025_reverse_nodes_in_k_group/Solution.kt @@ -1,4 +1,4 @@ -package g0001_0100.s0025_reverse_nodes_in_k_group; +package g0001_0100.s0025_reverse_nodes_in_k_group // #Hard #Top_100_Liked_Questions #Linked_List #Recursion #Data_Structure_II_Day_13_Linked_List // #Udemy_Linked_List #Big_O_Time_O(n)_Space_O(k) diff --git a/src/main/kotlin/g0001_0100/s0031_next_permutation/Solution.kt b/src/main/kotlin/g0001_0100/s0031_next_permutation/Solution.kt index 026e6c1..b360047 100644 --- a/src/main/kotlin/g0001_0100/s0031_next_permutation/Solution.kt +++ b/src/main/kotlin/g0001_0100/s0031_next_permutation/Solution.kt @@ -1,4 +1,4 @@ -package g0001_0100.s0031_next_permutation; +package g0001_0100.s0031_next_permutation // #Medium #Top_100_Liked_Questions #Array #Two_Pointers #Big_O_Time_O(n)_Space_O(1) diff --git a/src/main/kotlin/g0001_0100/s0032_longest_valid_parentheses/Solution.kt b/src/main/kotlin/g0001_0100/s0032_longest_valid_parentheses/Solution.kt index 40461dc..458e272 100644 --- a/src/main/kotlin/g0001_0100/s0032_longest_valid_parentheses/Solution.kt +++ b/src/main/kotlin/g0001_0100/s0032_longest_valid_parentheses/Solution.kt @@ -1,4 +1,4 @@ -package g0001_0100.s0032_longest_valid_parentheses; +package g0001_0100.s0032_longest_valid_parentheses // #Hard #Top_100_Liked_Questions #String #Dynamic_Programming #Stack #Big_O_Time_O(n)_Space_O(1) diff --git a/src/main/kotlin/g0001_0100/s0033_search_in_rotated_sorted_array/Solution.kt b/src/main/kotlin/g0001_0100/s0033_search_in_rotated_sorted_array/Solution.kt index d031ef1..bdcbd32 100644 --- a/src/main/kotlin/g0001_0100/s0033_search_in_rotated_sorted_array/Solution.kt +++ b/src/main/kotlin/g0001_0100/s0033_search_in_rotated_sorted_array/Solution.kt @@ -1,4 +1,4 @@ -package g0001_0100.s0033_search_in_rotated_sorted_array; +package g0001_0100.s0033_search_in_rotated_sorted_array // #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 diff --git a/src/main/kotlin/g0001_0100/s0034_find_first_and_last_position_of_element_in_sorted_array/Solution.kt b/src/main/kotlin/g0001_0100/s0034_find_first_and_last_position_of_element_in_sorted_array/Solution.kt index 21c20fd..b91c3a8 100644 --- a/src/main/kotlin/g0001_0100/s0034_find_first_and_last_position_of_element_in_sorted_array/Solution.kt +++ b/src/main/kotlin/g0001_0100/s0034_find_first_and_last_position_of_element_in_sorted_array/Solution.kt @@ -1,4 +1,4 @@ -package g0001_0100.s0034_find_first_and_last_position_of_element_in_sorted_array; +package g0001_0100.s0034_find_first_and_last_position_of_element_in_sorted_array // #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Array #Binary_Search // #Algorithm_II_Day_1_Binary_Search #Binary_Search_I_Day_5 #Big_O_Time_O(log_n)_Space_O(1) diff --git a/src/main/kotlin/g0001_0100/s0035_search_insert_position/Solution.kt b/src/main/kotlin/g0001_0100/s0035_search_insert_position/Solution.kt index ba9e18c..80ec8ed 100644 --- a/src/main/kotlin/g0001_0100/s0035_search_insert_position/Solution.kt +++ b/src/main/kotlin/g0001_0100/s0035_search_insert_position/Solution.kt @@ -1,4 +1,4 @@ -package g0001_0100.s0035_search_insert_position; +package g0001_0100.s0035_search_insert_position // #Easy #Top_100_Liked_Questions #Array #Binary_Search #Algorithm_I_Day_1_Binary_Search // #Binary_Search_I_Day_2 #Big_O_Time_O(log_n)_Space_O(1) diff --git a/src/main/kotlin/g0001_0100/s0039_combination_sum/Solution.kt b/src/main/kotlin/g0001_0100/s0039_combination_sum/Solution.kt index 3ff1cce..51345df 100644 --- a/src/main/kotlin/g0001_0100/s0039_combination_sum/Solution.kt +++ b/src/main/kotlin/g0001_0100/s0039_combination_sum/Solution.kt @@ -1,4 +1,4 @@ -package g0001_0100.s0039_combination_sum; +package g0001_0100.s0039_combination_sum // #Medium #Top_100_Liked_Questions #Array #Backtracking #Algorithm_II_Day_10_Recursion_Backtracking // #Level_2_Day_20_Brute_Force/Backtracking #Udemy_Backtracking/Recursion diff --git a/src/main/kotlin/g0001_0100/s0041_first_missing_positive/Solution.kt b/src/main/kotlin/g0001_0100/s0041_first_missing_positive/Solution.kt index 2e30520..7b8597c 100644 --- a/src/main/kotlin/g0001_0100/s0041_first_missing_positive/Solution.kt +++ b/src/main/kotlin/g0001_0100/s0041_first_missing_positive/Solution.kt @@ -1,4 +1,4 @@ -package g0001_0100.s0041_first_missing_positive; +package g0001_0100.s0041_first_missing_positive // #Hard #Top_100_Liked_Questions #Top_Interview_Questions #Array #Hash_Table #Udemy_Arrays // #Big_O_Time_O(n)_Space_O(n) diff --git a/src/main/kotlin/g0001_0100/s0042_trapping_rain_water/Solution.kt b/src/main/kotlin/g0001_0100/s0042_trapping_rain_water/Solution.kt index 52271a2..91994b3 100644 --- a/src/main/kotlin/g0001_0100/s0042_trapping_rain_water/Solution.kt +++ b/src/main/kotlin/g0001_0100/s0042_trapping_rain_water/Solution.kt @@ -1,4 +1,4 @@ -package g0001_0100.s0042_trapping_rain_water; +package g0001_0100.s0042_trapping_rain_water // #Hard #Top_100_Liked_Questions #Top_Interview_Questions #Array #Dynamic_Programming #Two_Pointers // #Stack #Monotonic_Stack #Dynamic_Programming_I_Day_9 #Udemy_Two_Pointers diff --git a/src/main/kotlin/g0001_0100/s0045_jump_game_ii/Solution.kt b/src/main/kotlin/g0001_0100/s0045_jump_game_ii/Solution.kt index 9bdd09c..09a9fa8 100644 --- a/src/main/kotlin/g0001_0100/s0045_jump_game_ii/Solution.kt +++ b/src/main/kotlin/g0001_0100/s0045_jump_game_ii/Solution.kt @@ -1,4 +1,4 @@ -package g0001_0100.s0045_jump_game_ii; +package g0001_0100.s0045_jump_game_ii // #Medium #Top_100_Liked_Questions #Array #Dynamic_Programming #Greedy // #Algorithm_II_Day_13_Dynamic_Programming #Dynamic_Programming_I_Day_4 diff --git a/src/main/kotlin/g0001_0100/s0046_permutations/Solution.kt b/src/main/kotlin/g0001_0100/s0046_permutations/Solution.kt index b682567..7bf4e0d 100644 --- a/src/main/kotlin/g0001_0100/s0046_permutations/Solution.kt +++ b/src/main/kotlin/g0001_0100/s0046_permutations/Solution.kt @@ -1,4 +1,4 @@ -package g0001_0100.s0046_permutations; +package g0001_0100.s0046_permutations // #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Array #Backtracking // #Algorithm_I_Day_11_Recursion_Backtracking #Level_2_Day_20_Brute_Force/Backtracking diff --git a/src/main/kotlin/g0001_0100/s0048_rotate_image/Solution.kt b/src/main/kotlin/g0001_0100/s0048_rotate_image/Solution.kt index fdeaef1..dfa6676 100644 --- a/src/main/kotlin/g0001_0100/s0048_rotate_image/Solution.kt +++ b/src/main/kotlin/g0001_0100/s0048_rotate_image/Solution.kt @@ -1,4 +1,4 @@ -package g0001_0100.s0048_rotate_image; +package g0001_0100.s0048_rotate_image // #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Array #Math #Matrix // #Data_Structure_II_Day_3_Array #Programming_Skills_II_Day_7 #Udemy_2D_Arrays/Matrix diff --git a/src/main/kotlin/g0001_0100/s0049_group_anagrams/Solution.kt b/src/main/kotlin/g0001_0100/s0049_group_anagrams/Solution.kt index d464b52..b297365 100644 --- a/src/main/kotlin/g0001_0100/s0049_group_anagrams/Solution.kt +++ b/src/main/kotlin/g0001_0100/s0049_group_anagrams/Solution.kt @@ -1,4 +1,4 @@ -package g0001_0100.s0049_group_anagrams; +package g0001_0100.s0049_group_anagrams // #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 diff --git a/src/main/kotlin/g0001_0100/s0051_n_queens/Solution.kt b/src/main/kotlin/g0001_0100/s0051_n_queens/Solution.kt index 1461edc..8c65d61 100644 --- a/src/main/kotlin/g0001_0100/s0051_n_queens/Solution.kt +++ b/src/main/kotlin/g0001_0100/s0051_n_queens/Solution.kt @@ -1,4 +1,4 @@ -package g0001_0100.s0051_n_queens; +package g0001_0100.s0051_n_queens // #Hard #Top_100_Liked_Questions #Array #Backtracking #Big_O_Time_O(N!)_Space_O(N) diff --git a/src/main/kotlin/g0001_0100/s0053_maximum_subarray/Solution.kt b/src/main/kotlin/g0001_0100/s0053_maximum_subarray/Solution.kt index 2b0d438..bd1dfa9 100644 --- a/src/main/kotlin/g0001_0100/s0053_maximum_subarray/Solution.kt +++ b/src/main/kotlin/g0001_0100/s0053_maximum_subarray/Solution.kt @@ -1,4 +1,4 @@ -package g0001_0100.s0053_maximum_subarray; +package g0001_0100.s0053_maximum_subarray // #Easy #Top_100_Liked_Questions #Top_Interview_Questions #Array #Dynamic_Programming // #Divide_and_Conquer #Data_Structure_I_Day_1_Array #Dynamic_Programming_I_Day_5 diff --git a/src/main/kotlin/g0001_0100/s0055_jump_game/Solution.kt b/src/main/kotlin/g0001_0100/s0055_jump_game/Solution.kt index 137fd7e..3b9686b 100644 --- a/src/main/kotlin/g0001_0100/s0055_jump_game/Solution.kt +++ b/src/main/kotlin/g0001_0100/s0055_jump_game/Solution.kt @@ -1,4 +1,4 @@ -package g0001_0100.s0055_jump_game; +package g0001_0100.s0055_jump_game // #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 diff --git a/src/main/kotlin/g0001_0100/s0056_merge_intervals/Solution.kt b/src/main/kotlin/g0001_0100/s0056_merge_intervals/Solution.kt index fce07c3..3f89aff 100644 --- a/src/main/kotlin/g0001_0100/s0056_merge_intervals/Solution.kt +++ b/src/main/kotlin/g0001_0100/s0056_merge_intervals/Solution.kt @@ -1,4 +1,4 @@ -package g0001_0100.s0056_merge_intervals; +package g0001_0100.s0056_merge_intervals // #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 diff --git a/src/main/kotlin/g0001_0100/s0062_unique_paths/Solution.kt b/src/main/kotlin/g0001_0100/s0062_unique_paths/Solution.kt index 2e1d067..7ac93d0 100644 --- a/src/main/kotlin/g0001_0100/s0062_unique_paths/Solution.kt +++ b/src/main/kotlin/g0001_0100/s0062_unique_paths/Solution.kt @@ -1,4 +1,4 @@ -package g0001_0100.s0062_unique_paths; +package g0001_0100.s0062_unique_paths // #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Dynamic_Programming #Math // #Combinatorics #Algorithm_II_Day_13_Dynamic_Programming #Dynamic_Programming_I_Day_15 diff --git a/src/main/kotlin/g0001_0100/s0064_minimum_path_sum/Solution.kt b/src/main/kotlin/g0001_0100/s0064_minimum_path_sum/Solution.kt index a1d4d1d..6dc4a04 100644 --- a/src/main/kotlin/g0001_0100/s0064_minimum_path_sum/Solution.kt +++ b/src/main/kotlin/g0001_0100/s0064_minimum_path_sum/Solution.kt @@ -1,4 +1,4 @@ -package g0001_0100.s0064_minimum_path_sum; +package g0001_0100.s0064_minimum_path_sum // #Medium #Top_100_Liked_Questions #Array #Dynamic_Programming #Matrix // #Dynamic_Programming_I_Day_16 #Udemy_Dynamic_Programming #Big_O_Time_O(m*n)_Space_O(m*n) diff --git a/src/main/kotlin/g0001_0100/s0070_climbing_stairs/Solution.kt b/src/main/kotlin/g0001_0100/s0070_climbing_stairs/Solution.kt index fa13e2b..bde4211 100644 --- a/src/main/kotlin/g0001_0100/s0070_climbing_stairs/Solution.kt +++ b/src/main/kotlin/g0001_0100/s0070_climbing_stairs/Solution.kt @@ -1,4 +1,4 @@ -package g0001_0100.s0070_climbing_stairs; +package g0001_0100.s0070_climbing_stairs // #Easy #Top_100_Liked_Questions #Top_Interview_Questions #Dynamic_Programming #Math #Memoization // #Algorithm_I_Day_12_Dynamic_Programming #Dynamic_Programming_I_Day_2 diff --git a/src/main/kotlin/g0001_0100/s0072_edit_distance/Solution.kt b/src/main/kotlin/g0001_0100/s0072_edit_distance/Solution.kt index ed96d15..a2c3961 100644 --- a/src/main/kotlin/g0001_0100/s0072_edit_distance/Solution.kt +++ b/src/main/kotlin/g0001_0100/s0072_edit_distance/Solution.kt @@ -1,4 +1,4 @@ -package g0001_0100.s0072_edit_distance; +package g0001_0100.s0072_edit_distance // #Hard #Top_100_Liked_Questions #String #Dynamic_Programming // #Algorithm_II_Day_18_Dynamic_Programming #Dynamic_Programming_I_Day_19 diff --git a/src/main/kotlin/g0001_0100/s0073_set_matrix_zeroes/Solution.kt b/src/main/kotlin/g0001_0100/s0073_set_matrix_zeroes/Solution.kt index 476fed6..54cfa2d 100644 --- a/src/main/kotlin/g0001_0100/s0073_set_matrix_zeroes/Solution.kt +++ b/src/main/kotlin/g0001_0100/s0073_set_matrix_zeroes/Solution.kt @@ -1,4 +1,4 @@ -package g0001_0100.s0073_set_matrix_zeroes; +package g0001_0100.s0073_set_matrix_zeroes // #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Array #Hash_Table #Matrix // #Udemy_2D_Arrays/Matrix #Big_O_Time_O(m*n)_Space_O(1) diff --git a/src/main/kotlin/g0001_0100/s0074_search_a_2d_matrix/Solution.kt b/src/main/kotlin/g0001_0100/s0074_search_a_2d_matrix/Solution.kt index 7fcf984..614d82d 100644 --- a/src/main/kotlin/g0001_0100/s0074_search_a_2d_matrix/Solution.kt +++ b/src/main/kotlin/g0001_0100/s0074_search_a_2d_matrix/Solution.kt @@ -1,4 +1,4 @@ -package g0001_0100.s0074_search_a_2d_matrix; +package g0001_0100.s0074_search_a_2d_matrix // #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 diff --git a/src/main/kotlin/g0001_0100/s0075_sort_colors/Solution.kt b/src/main/kotlin/g0001_0100/s0075_sort_colors/Solution.kt index c162331..4fc7c7a 100644 --- a/src/main/kotlin/g0001_0100/s0075_sort_colors/Solution.kt +++ b/src/main/kotlin/g0001_0100/s0075_sort_colors/Solution.kt @@ -1,4 +1,4 @@ -package g0001_0100.s0075_sort_colors; +package g0001_0100.s0075_sort_colors // #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Array #Sorting #Two_Pointers // #Data_Structure_II_Day_2_Array #Udemy_Arrays #Big_O_Time_O(n)_Space_O(1) diff --git a/src/main/kotlin/g0001_0100/s0076_minimum_window_substring/Solution.kt b/src/main/kotlin/g0001_0100/s0076_minimum_window_substring/Solution.kt index e97d3b7..b946236 100644 --- a/src/main/kotlin/g0001_0100/s0076_minimum_window_substring/Solution.kt +++ b/src/main/kotlin/g0001_0100/s0076_minimum_window_substring/Solution.kt @@ -1,4 +1,4 @@ -package g0001_0100.s0076_minimum_window_substring; +package g0001_0100.s0076_minimum_window_substring // #Hard #Top_100_Liked_Questions #Top_Interview_Questions #String #Hash_Table #Sliding_Window // #Level_2_Day_14_Sliding_Window/Two_Pointer #Big_O_Time_O(s.length())_Space_O(1) diff --git a/src/main/kotlin/g0001_0100/s0078_subsets/Solution.kt b/src/main/kotlin/g0001_0100/s0078_subsets/Solution.kt index ffb4af9..a966f38 100644 --- a/src/main/kotlin/g0001_0100/s0078_subsets/Solution.kt +++ b/src/main/kotlin/g0001_0100/s0078_subsets/Solution.kt @@ -1,4 +1,4 @@ -package g0001_0100.s0078_subsets; +package g0001_0100.s0078_subsets // #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Array #Bit_Manipulation #Backtracking // #Algorithm_II_Day_9_Recursion_Backtracking #Udemy_Backtracking/Recursion diff --git a/src/main/kotlin/g0001_0100/s0079_word_search/Solution.kt b/src/main/kotlin/g0001_0100/s0079_word_search/Solution.kt index 7eda706..2b901d2 100644 --- a/src/main/kotlin/g0001_0100/s0079_word_search/Solution.kt +++ b/src/main/kotlin/g0001_0100/s0079_word_search/Solution.kt @@ -1,4 +1,4 @@ -package g0001_0100.s0079_word_search; +package g0001_0100.s0079_word_search // #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Array #Matrix #Backtracking // #Algorithm_II_Day_11_Recursion_Backtracking #Big_O_Time_O(4^(m*n))_Space_O(m*n) diff --git a/src/main/kotlin/g0001_0100/s0084_largest_rectangle_in_histogram/Solution.kt b/src/main/kotlin/g0001_0100/s0084_largest_rectangle_in_histogram/Solution.kt index 59acdd7..957fb5c 100644 --- a/src/main/kotlin/g0001_0100/s0084_largest_rectangle_in_histogram/Solution.kt +++ b/src/main/kotlin/g0001_0100/s0084_largest_rectangle_in_histogram/Solution.kt @@ -1,4 +1,4 @@ -package g0001_0100.s0084_largest_rectangle_in_histogram; +package g0001_0100.s0084_largest_rectangle_in_histogram // #Hard #Top_100_Liked_Questions #Top_Interview_Questions #Array #Stack #Monotonic_Stack // #Big_O_Time_O(n_log_n)_Space_O(log_n) diff --git a/src/main/kotlin/g0001_0100/s0094_binary_tree_inorder_traversal/Solution.kt b/src/main/kotlin/g0001_0100/s0094_binary_tree_inorder_traversal/Solution.kt index 356bdab..dcd2dde 100644 --- a/src/main/kotlin/g0001_0100/s0094_binary_tree_inorder_traversal/Solution.kt +++ b/src/main/kotlin/g0001_0100/s0094_binary_tree_inorder_traversal/Solution.kt @@ -1,4 +1,4 @@ -package g0001_0100.s0094_binary_tree_inorder_traversal; +package g0001_0100.s0094_binary_tree_inorder_traversal // #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) diff --git a/src/main/kotlin/g0001_0100/s0096_unique_binary_search_trees/Solution.kt b/src/main/kotlin/g0001_0100/s0096_unique_binary_search_trees/Solution.kt index bf15809..a04a383 100644 --- a/src/main/kotlin/g0001_0100/s0096_unique_binary_search_trees/Solution.kt +++ b/src/main/kotlin/g0001_0100/s0096_unique_binary_search_trees/Solution.kt @@ -1,4 +1,4 @@ -package g0001_0100.s0096_unique_binary_search_trees; +package g0001_0100.s0096_unique_binary_search_trees // #Medium #Top_100_Liked_Questions #Dynamic_Programming #Math #Tree #Binary_Tree // #Binary_Search_Tree #Dynamic_Programming_I_Day_11 #Big_O_Time_O(n)_Space_O(1) diff --git a/src/main/kotlin/g0001_0100/s0098_validate_binary_search_tree/Solution.kt b/src/main/kotlin/g0001_0100/s0098_validate_binary_search_tree/Solution.kt index 752031a..e41ce48 100644 --- a/src/main/kotlin/g0001_0100/s0098_validate_binary_search_tree/Solution.kt +++ b/src/main/kotlin/g0001_0100/s0098_validate_binary_search_tree/Solution.kt @@ -1,4 +1,4 @@ -package g0001_0100.s0098_validate_binary_search_tree; +package g0001_0100.s0098_validate_binary_search_tree // #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 diff --git a/src/main/kotlin/g0101_0200/s0101_symmetric_tree/Solution.kt b/src/main/kotlin/g0101_0200/s0101_symmetric_tree/Solution.kt index 155f5e0..c995a82 100644 --- a/src/main/kotlin/g0101_0200/s0101_symmetric_tree/Solution.kt +++ b/src/main/kotlin/g0101_0200/s0101_symmetric_tree/Solution.kt @@ -1,4 +1,4 @@ -package g0101_0200.s0101_symmetric_tree; +package g0101_0200.s0101_symmetric_tree // #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 diff --git a/src/main/kotlin/g0101_0200/s0102_binary_tree_level_order_traversal/Solution.kt b/src/main/kotlin/g0101_0200/s0102_binary_tree_level_order_traversal/Solution.kt index 1186940..a1bfe42 100644 --- a/src/main/kotlin/g0101_0200/s0102_binary_tree_level_order_traversal/Solution.kt +++ b/src/main/kotlin/g0101_0200/s0102_binary_tree_level_order_traversal/Solution.kt @@ -1,4 +1,4 @@ -package g0101_0200.s0102_binary_tree_level_order_traversal; +package g0101_0200.s0102_binary_tree_level_order_traversal // #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 diff --git a/src/main/kotlin/g0101_0200/s0104_maximum_depth_of_binary_tree/Solution.kt b/src/main/kotlin/g0101_0200/s0104_maximum_depth_of_binary_tree/Solution.kt index 1334c6b..7bd1d07 100644 --- a/src/main/kotlin/g0101_0200/s0104_maximum_depth_of_binary_tree/Solution.kt +++ b/src/main/kotlin/g0101_0200/s0104_maximum_depth_of_binary_tree/Solution.kt @@ -1,4 +1,4 @@ -package g0101_0200.s0104_maximum_depth_of_binary_tree; +package g0101_0200.s0104_maximum_depth_of_binary_tree // #Easy #Top_100_Liked_Questions #Top_Interview_Questions #Depth_First_Search #Breadth_First_Search // #Tree #Binary_Tree #Data_Structure_I_Day_11_Tree diff --git a/src/main/kotlin/g0101_0200/s0105_construct_binary_tree_from_preorder_and_inorder_traversal/Solution.kt b/src/main/kotlin/g0101_0200/s0105_construct_binary_tree_from_preorder_and_inorder_traversal/Solution.kt index b2d3723..a45201b 100644 --- a/src/main/kotlin/g0101_0200/s0105_construct_binary_tree_from_preorder_and_inorder_traversal/Solution.kt +++ b/src/main/kotlin/g0101_0200/s0105_construct_binary_tree_from_preorder_and_inorder_traversal/Solution.kt @@ -1,4 +1,4 @@ -package g0101_0200.s0105_construct_binary_tree_from_preorder_and_inorder_traversal; +package g0101_0200.s0105_construct_binary_tree_from_preorder_and_inorder_traversal // #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Array #Hash_Table #Tree #Binary_Tree // #Divide_and_Conquer #Data_Structure_II_Day_15_Tree #Big_O_Time_O(N)_Space_O(N) diff --git a/src/main/kotlin/g0101_0200/s0114_flatten_binary_tree_to_linked_list/Solution.kt b/src/main/kotlin/g0101_0200/s0114_flatten_binary_tree_to_linked_list/Solution.kt index 681b454..cee1e53 100644 --- a/src/main/kotlin/g0101_0200/s0114_flatten_binary_tree_to_linked_list/Solution.kt +++ b/src/main/kotlin/g0101_0200/s0114_flatten_binary_tree_to_linked_list/Solution.kt @@ -1,4 +1,4 @@ -package g0101_0200.s0114_flatten_binary_tree_to_linked_list; +package g0101_0200.s0114_flatten_binary_tree_to_linked_list // #Medium #Top_100_Liked_Questions #Depth_First_Search #Tree #Binary_Tree #Stack #Linked_List // #Udemy_Linked_List #Big_O_Time_O(N)_Space_O(N) diff --git a/src/main/kotlin/g0101_0200/s0121_best_time_to_buy_and_sell_stock/Solution.kt b/src/main/kotlin/g0101_0200/s0121_best_time_to_buy_and_sell_stock/Solution.kt index 0287dc6..6160220 100644 --- a/src/main/kotlin/g0101_0200/s0121_best_time_to_buy_and_sell_stock/Solution.kt +++ b/src/main/kotlin/g0101_0200/s0121_best_time_to_buy_and_sell_stock/Solution.kt @@ -1,4 +1,4 @@ -package g0101_0200.s0121_best_time_to_buy_and_sell_stock; +package g0101_0200.s0121_best_time_to_buy_and_sell_stock // #Easy #Top_100_Liked_Questions #Top_Interview_Questions #Array #Dynamic_Programming // #Data_Structure_I_Day_3_Array #Dynamic_Programming_I_Day_7 #Level_1_Day_5_Greedy #Udemy_Arrays diff --git a/src/main/kotlin/g0101_0200/s0124_binary_tree_maximum_path_sum/Solution.kt b/src/main/kotlin/g0101_0200/s0124_binary_tree_maximum_path_sum/Solution.kt index f2b2fdd..a33e9a5 100644 --- a/src/main/kotlin/g0101_0200/s0124_binary_tree_maximum_path_sum/Solution.kt +++ b/src/main/kotlin/g0101_0200/s0124_binary_tree_maximum_path_sum/Solution.kt @@ -1,4 +1,4 @@ -package g0101_0200.s0124_binary_tree_maximum_path_sum; +package g0101_0200.s0124_binary_tree_maximum_path_sum // #Hard #Top_100_Liked_Questions #Top_Interview_Questions #Dynamic_Programming #Depth_First_Search // #Tree #Binary_Tree #Udemy_Tree_Stack_Queue #Big_O_Time_O(N)_Space_O(N) diff --git a/src/main/kotlin/g0101_0200/s0128_longest_consecutive_sequence/Solution.kt b/src/main/kotlin/g0101_0200/s0128_longest_consecutive_sequence/Solution.kt index c113352..77929e6 100644 --- a/src/main/kotlin/g0101_0200/s0128_longest_consecutive_sequence/Solution.kt +++ b/src/main/kotlin/g0101_0200/s0128_longest_consecutive_sequence/Solution.kt @@ -1,4 +1,4 @@ -package g0101_0200.s0128_longest_consecutive_sequence; +package g0101_0200.s0128_longest_consecutive_sequence // #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Array #Hash_Table #Union_Find // #Big_O_Time_O(N_log_N)_Space_O(1) diff --git a/src/main/kotlin/g0101_0200/s0131_palindrome_partitioning/Solution.kt b/src/main/kotlin/g0101_0200/s0131_palindrome_partitioning/Solution.kt index 665420a..ef9420b 100644 --- a/src/main/kotlin/g0101_0200/s0131_palindrome_partitioning/Solution.kt +++ b/src/main/kotlin/g0101_0200/s0131_palindrome_partitioning/Solution.kt @@ -1,4 +1,4 @@ -package g0101_0200.s0131_palindrome_partitioning; +package g0101_0200.s0131_palindrome_partitioning // #Medium #Top_100_Liked_Questions #Top_Interview_Questions #String #Dynamic_Programming // #Backtracking #Big_O_Time_O(N*2^N)_Space_O(2^N*N) diff --git a/src/main/kotlin/g0101_0200/s0136_single_number/Solution.kt b/src/main/kotlin/g0101_0200/s0136_single_number/Solution.kt index 9b728e9..40a3915 100644 --- a/src/main/kotlin/g0101_0200/s0136_single_number/Solution.kt +++ b/src/main/kotlin/g0101_0200/s0136_single_number/Solution.kt @@ -1,4 +1,4 @@ -package g0101_0200.s0136_single_number; +package g0101_0200.s0136_single_number // #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 diff --git a/src/main/kotlin/g0101_0200/s0138_copy_list_with_random_pointer/Solution.kt b/src/main/kotlin/g0101_0200/s0138_copy_list_with_random_pointer/Solution.kt index 7ab7268..6289f23 100644 --- a/src/main/kotlin/g0101_0200/s0138_copy_list_with_random_pointer/Solution.kt +++ b/src/main/kotlin/g0101_0200/s0138_copy_list_with_random_pointer/Solution.kt @@ -1,4 +1,4 @@ -package g0101_0200.s0138_copy_list_with_random_pointer; +package g0101_0200.s0138_copy_list_with_random_pointer // #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Hash_Table #Linked_List // #Programming_Skills_II_Day_14 #Udemy_Linked_List #Big_O_Time_O(N)_Space_O(N) diff --git a/src/main/kotlin/g0101_0200/s0139_word_break/Solution.kt b/src/main/kotlin/g0101_0200/s0139_word_break/Solution.kt index 15d699f..271be6e 100644 --- a/src/main/kotlin/g0101_0200/s0139_word_break/Solution.kt +++ b/src/main/kotlin/g0101_0200/s0139_word_break/Solution.kt @@ -1,4 +1,4 @@ -package g0101_0200.s0139_word_break; +package g0101_0200.s0139_word_break // #Medium #Top_100_Liked_Questions #Top_Interview_Questions #String #Hash_Table // #Dynamic_Programming #Trie #Memoization #Algorithm_II_Day_15_Dynamic_Programming diff --git a/src/main/kotlin/g0101_0200/s0141_linked_list_cycle/Solution.kt b/src/main/kotlin/g0101_0200/s0141_linked_list_cycle/Solution.kt index 0c691f1..cf3b6e7 100644 --- a/src/main/kotlin/g0101_0200/s0141_linked_list_cycle/Solution.kt +++ b/src/main/kotlin/g0101_0200/s0141_linked_list_cycle/Solution.kt @@ -1,4 +1,4 @@ -package g0101_0200.s0141_linked_list_cycle; +package g0101_0200.s0141_linked_list_cycle // #Easy #Top_100_Liked_Questions #Top_Interview_Questions #Hash_Table #Two_Pointers #Linked_List // #Data_Structure_I_Day_7_Linked_List #Udemy_Linked_List #Big_O_Time_O(N)_Space_O(1) diff --git a/src/main/kotlin/g0101_0200/s0142_linked_list_cycle_ii/Solution.kt b/src/main/kotlin/g0101_0200/s0142_linked_list_cycle_ii/Solution.kt index 1779b51..17bfba4 100644 --- a/src/main/kotlin/g0101_0200/s0142_linked_list_cycle_ii/Solution.kt +++ b/src/main/kotlin/g0101_0200/s0142_linked_list_cycle_ii/Solution.kt @@ -1,4 +1,4 @@ -package g0101_0200.s0142_linked_list_cycle_ii; +package g0101_0200.s0142_linked_list_cycle_ii // #Medium #Top_100_Liked_Questions #Hash_Table #Two_Pointers #Linked_List // #Data_Structure_II_Day_10_Linked_List #Level_1_Day_4_Linked_List #Udemy_Linked_List diff --git a/src/main/kotlin/g0101_0200/s0146_lru_cache/LRUCache.kt b/src/main/kotlin/g0101_0200/s0146_lru_cache/LRUCache.kt index 5fcc8c0..dd0b333 100644 --- a/src/main/kotlin/g0101_0200/s0146_lru_cache/LRUCache.kt +++ b/src/main/kotlin/g0101_0200/s0146_lru_cache/LRUCache.kt @@ -1,4 +1,4 @@ -package g0101_0200.s0146_lru_cache; +package g0101_0200.s0146_lru_cache // #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Hash_Table #Design #Linked_List // #Doubly_Linked_List #Udemy_Linked_List #Big_O_Time_O(1)_Space_O(capacity) diff --git a/src/main/kotlin/g0101_0200/s0148_sort_list/Solution.kt b/src/main/kotlin/g0101_0200/s0148_sort_list/Solution.kt index 3dc289c..301443c 100644 --- a/src/main/kotlin/g0101_0200/s0148_sort_list/Solution.kt +++ b/src/main/kotlin/g0101_0200/s0148_sort_list/Solution.kt @@ -1,4 +1,4 @@ -package g0101_0200.s0148_sort_list; +package g0101_0200.s0148_sort_list // #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Sorting #Two_Pointers #Linked_List // #Divide_and_Conquer #Merge_Sort #Level_2_Day_4_Linked_List #Big_O_Time_O(log(N))_Space_O(log(N)) diff --git a/src/main/kotlin/g0101_0200/s0152_maximum_product_subarray/Solution.kt b/src/main/kotlin/g0101_0200/s0152_maximum_product_subarray/Solution.kt index 5169483..45ce552 100644 --- a/src/main/kotlin/g0101_0200/s0152_maximum_product_subarray/Solution.kt +++ b/src/main/kotlin/g0101_0200/s0152_maximum_product_subarray/Solution.kt @@ -1,4 +1,4 @@ -package g0101_0200.s0152_maximum_product_subarray; +package g0101_0200.s0152_maximum_product_subarray // #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Array #Dynamic_Programming // #Dynamic_Programming_I_Day_6 #Level_2_Day_13_Dynamic_Programming #Udemy_Dynamic_Programming diff --git a/src/main/kotlin/g0101_0200/s0153_find_minimum_in_rotated_sorted_array/Solution.kt b/src/main/kotlin/g0101_0200/s0153_find_minimum_in_rotated_sorted_array/Solution.kt index 7fb00b3..fd3c5f0 100644 --- a/src/main/kotlin/g0101_0200/s0153_find_minimum_in_rotated_sorted_array/Solution.kt +++ b/src/main/kotlin/g0101_0200/s0153_find_minimum_in_rotated_sorted_array/Solution.kt @@ -1,4 +1,4 @@ -package g0101_0200.s0153_find_minimum_in_rotated_sorted_array; +package g0101_0200.s0153_find_minimum_in_rotated_sorted_array // #Medium #Top_100_Liked_Questions #Array #Binary_Search #Algorithm_II_Day_2_Binary_Search // #Binary_Search_I_Day_12 #Udemy_Binary_Search #Big_O_Time_O(log_N)_Space_O(log_N) diff --git a/src/main/kotlin/g0101_0200/s0155_min_stack/MinStack.kt b/src/main/kotlin/g0101_0200/s0155_min_stack/MinStack.kt index 3732994..78f003b 100644 --- a/src/main/kotlin/g0101_0200/s0155_min_stack/MinStack.kt +++ b/src/main/kotlin/g0101_0200/s0155_min_stack/MinStack.kt @@ -1,4 +1,4 @@ -package g0101_0200.s0155_min_stack; +package g0101_0200.s0155_min_stack // #Easy #Top_100_Liked_Questions #Top_Interview_Questions #Stack #Design // #Data_Structure_II_Day_14_Stack_Queue #Programming_Skills_II_Day_18 #Level_2_Day_16_Design diff --git a/src/main/kotlin/g0101_0200/s0160_intersection_of_two_linked_lists/Solution.kt b/src/main/kotlin/g0101_0200/s0160_intersection_of_two_linked_lists/Solution.kt index 0b71fd0..4871700 100644 --- a/src/main/kotlin/g0101_0200/s0160_intersection_of_two_linked_lists/Solution.kt +++ b/src/main/kotlin/g0101_0200/s0160_intersection_of_two_linked_lists/Solution.kt @@ -1,4 +1,4 @@ -package g0101_0200.s0160_intersection_of_two_linked_lists; +package g0101_0200.s0160_intersection_of_two_linked_lists // #Easy #Top_100_Liked_Questions #Top_Interview_Questions #Hash_Table #Two_Pointers #Linked_List // #Data_Structure_II_Day_11_Linked_List #Udemy_Linked_List #Big_O_Time_O(M+N)_Space_O(1) diff --git a/src/main/kotlin/g0101_0200/s0169_majority_element/Solution.kt b/src/main/kotlin/g0101_0200/s0169_majority_element/Solution.kt index 22da240..f34ed84 100644 --- a/src/main/kotlin/g0101_0200/s0169_majority_element/Solution.kt +++ b/src/main/kotlin/g0101_0200/s0169_majority_element/Solution.kt @@ -1,4 +1,4 @@ -package g0101_0200.s0169_majority_element; +package g0101_0200.s0169_majority_element // #Easy #Top_100_Liked_Questions #Top_Interview_Questions #Array #Hash_Table #Sorting #Counting // #Divide_and_Conquer #Data_Structure_II_Day_1_Array #Udemy_Famous_Algorithm diff --git a/src/main/kotlin/g0101_0200/s0189_rotate_array/Solution.kt b/src/main/kotlin/g0101_0200/s0189_rotate_array/Solution.kt index 1376d12..9970fef 100644 --- a/src/main/kotlin/g0101_0200/s0189_rotate_array/Solution.kt +++ b/src/main/kotlin/g0101_0200/s0189_rotate_array/Solution.kt @@ -1,4 +1,4 @@ -package g0101_0200.s0189_rotate_array; +package g0101_0200.s0189_rotate_array // #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Array #Math #Two_Pointers // #Algorithm_I_Day_2_Two_Pointers #Udemy_Arrays #Big_O_Time_O(n)_Space_O(1) diff --git a/src/main/kotlin/g0101_0200/s0198_house_robber/Solution.kt b/src/main/kotlin/g0101_0200/s0198_house_robber/Solution.kt index 121ed3b..e095e29 100644 --- a/src/main/kotlin/g0101_0200/s0198_house_robber/Solution.kt +++ b/src/main/kotlin/g0101_0200/s0198_house_robber/Solution.kt @@ -1,4 +1,4 @@ -package g0101_0200.s0198_house_robber; +package g0101_0200.s0198_house_robber // #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Array #Dynamic_Programming // #Algorithm_I_Day_12_Dynamic_Programming #Dynamic_Programming_I_Day_3 diff --git a/src/main/kotlin/g0101_0200/s0200_number_of_islands/Solution.kt b/src/main/kotlin/g0101_0200/s0200_number_of_islands/Solution.kt index 34c21ea..1498e48 100644 --- a/src/main/kotlin/g0101_0200/s0200_number_of_islands/Solution.kt +++ b/src/main/kotlin/g0101_0200/s0200_number_of_islands/Solution.kt @@ -1,4 +1,4 @@ -package g0101_0200.s0200_number_of_islands; +package g0101_0200.s0200_number_of_islands // #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Array #Depth_First_Search // #Breadth_First_Search #Matrix #Union_Find diff --git a/src/main/kotlin/g0201_0300/s0206_reverse_linked_list/Solution.kt b/src/main/kotlin/g0201_0300/s0206_reverse_linked_list/Solution.kt index f59b946..6d1c635 100644 --- a/src/main/kotlin/g0201_0300/s0206_reverse_linked_list/Solution.kt +++ b/src/main/kotlin/g0201_0300/s0206_reverse_linked_list/Solution.kt @@ -1,4 +1,4 @@ -package g0201_0300.s0206_reverse_linked_list; +package g0201_0300.s0206_reverse_linked_list // #Easy #Top_100_Liked_Questions #Top_Interview_Questions #Linked_List #Recursion // #Data_Structure_I_Day_8_Linked_List #Algorithm_I_Day_10_Recursion_Backtracking diff --git a/src/main/kotlin/g0201_0300/s0207_course_schedule/Solution.kt b/src/main/kotlin/g0201_0300/s0207_course_schedule/Solution.kt index 8b5a75b..fb85d5e 100644 --- a/src/main/kotlin/g0201_0300/s0207_course_schedule/Solution.kt +++ b/src/main/kotlin/g0201_0300/s0207_course_schedule/Solution.kt @@ -1,4 +1,4 @@ -package g0201_0300.s0207_course_schedule; +package g0201_0300.s0207_course_schedule // #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Depth_First_Search // #Breadth_First_Search #Graph #Topological_Sort #Big_O_Time_O(N)_Space_O(N) diff --git a/src/main/kotlin/g0201_0300/s0208_implement_trie_prefix_tree/Trie.kt b/src/main/kotlin/g0201_0300/s0208_implement_trie_prefix_tree/Trie.kt index 728a207..6e2648b 100644 --- a/src/main/kotlin/g0201_0300/s0208_implement_trie_prefix_tree/Trie.kt +++ b/src/main/kotlin/g0201_0300/s0208_implement_trie_prefix_tree/Trie.kt @@ -1,4 +1,4 @@ -package g0201_0300.s0208_implement_trie_prefix_tree; +package g0201_0300.s0208_implement_trie_prefix_tree // #Medium #Top_100_Liked_Questions #Top_Interview_Questions #String #Hash_Table #Design #Trie // #Level_2_Day_16_Design #Udemy_Trie_and_Heap diff --git a/src/main/kotlin/g0201_0300/s0215_kth_largest_element_in_an_array/Solution.kt b/src/main/kotlin/g0201_0300/s0215_kth_largest_element_in_an_array/Solution.kt index 3bf09e0..4fe2885 100644 --- a/src/main/kotlin/g0201_0300/s0215_kth_largest_element_in_an_array/Solution.kt +++ b/src/main/kotlin/g0201_0300/s0215_kth_largest_element_in_an_array/Solution.kt @@ -1,4 +1,4 @@ -package g0201_0300.s0215_kth_largest_element_in_an_array; +package g0201_0300.s0215_kth_largest_element_in_an_array // #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 diff --git a/src/main/kotlin/g0201_0300/s0221_maximal_square/Solution.kt b/src/main/kotlin/g0201_0300/s0221_maximal_square/Solution.kt index 835b905..88f9da3 100644 --- a/src/main/kotlin/g0201_0300/s0221_maximal_square/Solution.kt +++ b/src/main/kotlin/g0201_0300/s0221_maximal_square/Solution.kt @@ -1,4 +1,4 @@ -package g0201_0300.s0221_maximal_square; +package g0201_0300.s0221_maximal_square // #Medium #Top_100_Liked_Questions #Array #Dynamic_Programming #Matrix // #Dynamic_Programming_I_Day_16 #Big_O_Time_O(m*n)_Space_O(m*n) diff --git a/src/main/kotlin/g0201_0300/s0226_invert_binary_tree/Solution.kt b/src/main/kotlin/g0201_0300/s0226_invert_binary_tree/Solution.kt index 09ea09e..f930d0f 100644 --- a/src/main/kotlin/g0201_0300/s0226_invert_binary_tree/Solution.kt +++ b/src/main/kotlin/g0201_0300/s0226_invert_binary_tree/Solution.kt @@ -1,4 +1,4 @@ -package g0201_0300.s0226_invert_binary_tree; +package g0201_0300.s0226_invert_binary_tree // #Easy #Top_100_Liked_Questions #Depth_First_Search #Breadth_First_Search #Tree #Binary_Tree // #Data_Structure_I_Day_12_Tree #Level_2_Day_6_Tree #Udemy_Tree_Stack_Queue diff --git a/src/main/kotlin/g0201_0300/s0230_kth_smallest_element_in_a_bst/Solution.kt b/src/main/kotlin/g0201_0300/s0230_kth_smallest_element_in_a_bst/Solution.kt index e9cf844..f9a72e8 100644 --- a/src/main/kotlin/g0201_0300/s0230_kth_smallest_element_in_a_bst/Solution.kt +++ b/src/main/kotlin/g0201_0300/s0230_kth_smallest_element_in_a_bst/Solution.kt @@ -1,4 +1,4 @@ -package g0201_0300.s0230_kth_smallest_element_in_a_bst; +package g0201_0300.s0230_kth_smallest_element_in_a_bst // #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Depth_First_Search #Tree #Binary_Tree // #Binary_Search_Tree #Data_Structure_II_Day_17_Tree #Level_2_Day_9_Binary_Search_Tree diff --git a/src/main/kotlin/g0201_0300/s0234_palindrome_linked_list/Solution.kt b/src/main/kotlin/g0201_0300/s0234_palindrome_linked_list/Solution.kt index a92aa4f..42326e1 100644 --- a/src/main/kotlin/g0201_0300/s0234_palindrome_linked_list/Solution.kt +++ b/src/main/kotlin/g0201_0300/s0234_palindrome_linked_list/Solution.kt @@ -1,4 +1,4 @@ -package g0201_0300.s0234_palindrome_linked_list; +package g0201_0300.s0234_palindrome_linked_list // #Easy #Top_100_Liked_Questions #Top_Interview_Questions #Two_Pointers #Stack #Linked_List // #Recursion #Level_2_Day_3_Linked_List #Udemy_Linked_List #Big_O_Time_O(n)_Space_O(1) diff --git a/src/main/kotlin/g0201_0300/s0236_lowest_common_ancestor_of_a_binary_tree/Solution.kt b/src/main/kotlin/g0201_0300/s0236_lowest_common_ancestor_of_a_binary_tree/Solution.kt index e20a8fc..4ee4db4 100644 --- a/src/main/kotlin/g0201_0300/s0236_lowest_common_ancestor_of_a_binary_tree/Solution.kt +++ b/src/main/kotlin/g0201_0300/s0236_lowest_common_ancestor_of_a_binary_tree/Solution.kt @@ -1,4 +1,4 @@ -package g0201_0300.s0236_lowest_common_ancestor_of_a_binary_tree; +package g0201_0300.s0236_lowest_common_ancestor_of_a_binary_tree // #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Depth_First_Search #Tree #Binary_Tree // #Data_Structure_II_Day_18_Tree #Udemy_Tree_Stack_Queue #Big_O_Time_O(n)_Space_O(n) diff --git a/src/main/kotlin/g0201_0300/s0238_product_of_array_except_self/Solution.kt b/src/main/kotlin/g0201_0300/s0238_product_of_array_except_self/Solution.kt index b840255..5383015 100644 --- a/src/main/kotlin/g0201_0300/s0238_product_of_array_except_self/Solution.kt +++ b/src/main/kotlin/g0201_0300/s0238_product_of_array_except_self/Solution.kt @@ -1,4 +1,4 @@ -package g0201_0300.s0238_product_of_array_except_self; +package g0201_0300.s0238_product_of_array_except_self // #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Array #Prefix_Sum // #Data_Structure_II_Day_5_Array #Udemy_Arrays #Big_O_Time_O(n^2)_Space_O(n) diff --git a/src/main/kotlin/g0201_0300/s0239_sliding_window_maximum/Solution.kt b/src/main/kotlin/g0201_0300/s0239_sliding_window_maximum/Solution.kt index f7c2e78..5322a58 100644 --- a/src/main/kotlin/g0201_0300/s0239_sliding_window_maximum/Solution.kt +++ b/src/main/kotlin/g0201_0300/s0239_sliding_window_maximum/Solution.kt @@ -1,4 +1,4 @@ -package g0201_0300.s0239_sliding_window_maximum; +package g0201_0300.s0239_sliding_window_maximum // #Hard #Top_100_Liked_Questions #Top_Interview_Questions #Array #Heap_Priority_Queue // #Sliding_Window #Queue #Monotonic_Queue #Udemy_Arrays #Big_O_Time_O(n*k)_Space_O(n+k) diff --git a/src/main/kotlin/g0201_0300/s0240_search_a_2d_matrix_ii/Solution.kt b/src/main/kotlin/g0201_0300/s0240_search_a_2d_matrix_ii/Solution.kt index 05b268e..75a313e 100644 --- a/src/main/kotlin/g0201_0300/s0240_search_a_2d_matrix_ii/Solution.kt +++ b/src/main/kotlin/g0201_0300/s0240_search_a_2d_matrix_ii/Solution.kt @@ -1,4 +1,4 @@ -package g0201_0300.s0240_search_a_2d_matrix_ii; +package g0201_0300.s0240_search_a_2d_matrix_ii // #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Array #Binary_Search #Matrix // #Divide_and_Conquer #Data_Structure_II_Day_4_Array #Binary_Search_II_Day_8 diff --git a/src/main/kotlin/g0201_0300/s0283_move_zeroes/Solution.kt b/src/main/kotlin/g0201_0300/s0283_move_zeroes/Solution.kt index a13228b..d3d1af6 100644 --- a/src/main/kotlin/g0201_0300/s0283_move_zeroes/Solution.kt +++ b/src/main/kotlin/g0201_0300/s0283_move_zeroes/Solution.kt @@ -1,4 +1,4 @@ -package g0201_0300.s0283_move_zeroes; +package g0201_0300.s0283_move_zeroes // #Easy #Top_100_Liked_Questions #Top_Interview_Questions #Array #Two_Pointers // #Algorithm_I_Day_3_Two_Pointers #Programming_Skills_I_Day_6_Array #Udemy_Arrays diff --git a/src/main/kotlin/g0201_0300/s0287_find_the_duplicate_number/Solution.kt b/src/main/kotlin/g0201_0300/s0287_find_the_duplicate_number/Solution.kt index 2fe8661..1631fa1 100644 --- a/src/main/kotlin/g0201_0300/s0287_find_the_duplicate_number/Solution.kt +++ b/src/main/kotlin/g0201_0300/s0287_find_the_duplicate_number/Solution.kt @@ -1,4 +1,4 @@ -package g0201_0300.s0287_find_the_duplicate_number; +package g0201_0300.s0287_find_the_duplicate_number // #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Array #Binary_Search #Two_Pointers // #Bit_Manipulation #Binary_Search_II_Day_5 #Big_O_Time_O(n)_Space_O(n) diff --git a/src/main/kotlin/g0201_0300/s0295_find_median_from_data_stream/MedianFinder.kt b/src/main/kotlin/g0201_0300/s0295_find_median_from_data_stream/MedianFinder.kt index ab0153c..012c302 100644 --- a/src/main/kotlin/g0201_0300/s0295_find_median_from_data_stream/MedianFinder.kt +++ b/src/main/kotlin/g0201_0300/s0295_find_median_from_data_stream/MedianFinder.kt @@ -1,4 +1,4 @@ -package g0201_0300.s0295_find_median_from_data_stream; +package g0201_0300.s0295_find_median_from_data_stream // #Hard #Top_100_Liked_Questions #Top_Interview_Questions #Sorting #Two_Pointers #Design // #Heap_Priority_Queue #Data_Stream #Big_O_Time_O(n*log_n)_Space_O(n) diff --git a/src/main/kotlin/g0201_0300/s0300_longest_increasing_subsequence/Solution.kt b/src/main/kotlin/g0201_0300/s0300_longest_increasing_subsequence/Solution.kt index 59dfdda..8e36315 100644 --- a/src/main/kotlin/g0201_0300/s0300_longest_increasing_subsequence/Solution.kt +++ b/src/main/kotlin/g0201_0300/s0300_longest_increasing_subsequence/Solution.kt @@ -1,4 +1,4 @@ -package g0201_0300.s0300_longest_increasing_subsequence; +package g0201_0300.s0300_longest_increasing_subsequence // #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Array #Dynamic_Programming // #Binary_Search #Algorithm_II_Day_16_Dynamic_Programming #Binary_Search_II_Day_3 diff --git a/src/main/kotlin/g0301_0400/s0322_coin_change/Solution.kt b/src/main/kotlin/g0301_0400/s0322_coin_change/Solution.kt index d386c48..e24b2c2 100644 --- a/src/main/kotlin/g0301_0400/s0322_coin_change/Solution.kt +++ b/src/main/kotlin/g0301_0400/s0322_coin_change/Solution.kt @@ -1,4 +1,4 @@ -package g0301_0400.s0322_coin_change; +package g0301_0400.s0322_coin_change // #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Array #Dynamic_Programming // #Breadth_First_Search #Algorithm_II_Day_18_Dynamic_Programming #Dynamic_Programming_I_Day_20 diff --git a/src/main/kotlin/g0301_0400/s0338_counting_bits/Solution.kt b/src/main/kotlin/g0301_0400/s0338_counting_bits/Solution.kt index 1708b7d..9aff105 100644 --- a/src/main/kotlin/g0301_0400/s0338_counting_bits/Solution.kt +++ b/src/main/kotlin/g0301_0400/s0338_counting_bits/Solution.kt @@ -1,4 +1,4 @@ -package g0301_0400.s0338_counting_bits; +package g0301_0400.s0338_counting_bits // #Easy #Top_100_Liked_Questions #Dynamic_Programming #Bit_Manipulation #Udemy_Bit_Manipulation // #Big_O_Time_O(num)_Space_O(num) diff --git a/src/main/kotlin/g0301_0400/s0347_top_k_frequent_elements/Solution.kt b/src/main/kotlin/g0301_0400/s0347_top_k_frequent_elements/Solution.kt index e694b16..20e9710 100644 --- a/src/main/kotlin/g0301_0400/s0347_top_k_frequent_elements/Solution.kt +++ b/src/main/kotlin/g0301_0400/s0347_top_k_frequent_elements/Solution.kt @@ -1,4 +1,4 @@ -package g0301_0400.s0347_top_k_frequent_elements; +package g0301_0400.s0347_top_k_frequent_elements // #Medium #Top_100_Liked_Questions #Top_Interview_Questions #Array #Hash_Table #Sorting // #Heap_Priority_Queue #Counting #Divide_and_Conquer #Quickselect #Bucket_Sort diff --git a/src/main/kotlin/g0301_0400/s0394_decode_string/Solution.kt b/src/main/kotlin/g0301_0400/s0394_decode_string/Solution.kt index d72ba0c..a047f73 100644 --- a/src/main/kotlin/g0301_0400/s0394_decode_string/Solution.kt +++ b/src/main/kotlin/g0301_0400/s0394_decode_string/Solution.kt @@ -1,4 +1,4 @@ -package g0301_0400.s0394_decode_string; +package g0301_0400.s0394_decode_string // #Medium #Top_100_Liked_Questions #String #Stack #Recursion #Level_1_Day_14_Stack #Udemy_Strings // #Big_O_Time_O(n)_Space_O(n) diff --git a/src/main/kotlin/g0401_0500/s0416_partition_equal_subset_sum/Solution.kt b/src/main/kotlin/g0401_0500/s0416_partition_equal_subset_sum/Solution.kt index 3df835e..84a8f4e 100644 --- a/src/main/kotlin/g0401_0500/s0416_partition_equal_subset_sum/Solution.kt +++ b/src/main/kotlin/g0401_0500/s0416_partition_equal_subset_sum/Solution.kt @@ -1,4 +1,4 @@ -package g0401_0500.s0416_partition_equal_subset_sum; +package g0401_0500.s0416_partition_equal_subset_sum // #Medium #Top_100_Liked_Questions #Array #Dynamic_Programming #Level_2_Day_13_Dynamic_Programming // #Big_O_Time_O(n*sums)_Space_O(n*sums) diff --git a/src/main/kotlin/g0401_0500/s0437_path_sum_iii/Solution.kt b/src/main/kotlin/g0401_0500/s0437_path_sum_iii/Solution.kt index d9894ca..8041a38 100644 --- a/src/main/kotlin/g0401_0500/s0437_path_sum_iii/Solution.kt +++ b/src/main/kotlin/g0401_0500/s0437_path_sum_iii/Solution.kt @@ -1,4 +1,4 @@ -package g0401_0500.s0437_path_sum_iii; +package g0401_0500.s0437_path_sum_iii // #Medium #Top_100_Liked_Questions #Depth_First_Search #Tree #Binary_Tree #Level_2_Day_7_Tree // #Big_O_Time_O(n)_Space_O(n) diff --git a/src/main/kotlin/g0401_0500/s0438_find_all_anagrams_in_a_string/Solution.kt b/src/main/kotlin/g0401_0500/s0438_find_all_anagrams_in_a_string/Solution.kt index 27a579e..0642ed2 100644 --- a/src/main/kotlin/g0401_0500/s0438_find_all_anagrams_in_a_string/Solution.kt +++ b/src/main/kotlin/g0401_0500/s0438_find_all_anagrams_in_a_string/Solution.kt @@ -1,4 +1,4 @@ -package g0401_0500.s0438_find_all_anagrams_in_a_string; +package g0401_0500.s0438_find_all_anagrams_in_a_string // #Medium #Top_100_Liked_Questions #String #Hash_Table #Sliding_Window // #Algorithm_II_Day_5_Sliding_Window #Programming_Skills_II_Day_12 diff --git a/src/main/kotlin/g0401_0500/s0494_target_sum/Solution.kt b/src/main/kotlin/g0401_0500/s0494_target_sum/Solution.kt index f0a4e19..e381a42 100644 --- a/src/main/kotlin/g0401_0500/s0494_target_sum/Solution.kt +++ b/src/main/kotlin/g0401_0500/s0494_target_sum/Solution.kt @@ -1,4 +1,4 @@ -package g0401_0500.s0494_target_sum; +package g0401_0500.s0494_target_sum // #Medium #Top_100_Liked_Questions #Array #Dynamic_Programming #Backtracking // #Big_O_Time_O(n*(sum+s))_Space_O(n*(sum+s)) diff --git a/src/main/kotlin/g0501_0600/s0543_diameter_of_binary_tree/Solution.kt b/src/main/kotlin/g0501_0600/s0543_diameter_of_binary_tree/Solution.kt index 1884b9f..92bbd3d 100644 --- a/src/main/kotlin/g0501_0600/s0543_diameter_of_binary_tree/Solution.kt +++ b/src/main/kotlin/g0501_0600/s0543_diameter_of_binary_tree/Solution.kt @@ -1,4 +1,4 @@ -package g0501_0600.s0543_diameter_of_binary_tree; +package g0501_0600.s0543_diameter_of_binary_tree // #Easy #Top_100_Liked_Questions #Depth_First_Search #Tree #Binary_Tree #Level_2_Day_7_Tree // #Udemy_Tree_Stack_Queue #Big_O_Time_O(n)_Space_O(n) diff --git a/src/main/kotlin/g0501_0600/s0560_subarray_sum_equals_k/Solution.kt b/src/main/kotlin/g0501_0600/s0560_subarray_sum_equals_k/Solution.kt index 1d5dafe..acdf797 100644 --- a/src/main/kotlin/g0501_0600/s0560_subarray_sum_equals_k/Solution.kt +++ b/src/main/kotlin/g0501_0600/s0560_subarray_sum_equals_k/Solution.kt @@ -1,4 +1,4 @@ -package g0501_0600.s0560_subarray_sum_equals_k; +package g0501_0600.s0560_subarray_sum_equals_k // #Medium #Top_100_Liked_Questions #Array #Hash_Table #Prefix_Sum #Data_Structure_II_Day_5_Array // #Big_O_Time_O(n)_Space_O(n) diff --git a/src/main/kotlin/g0601_0700/s0647_palindromic_substrings/Solution.kt b/src/main/kotlin/g0601_0700/s0647_palindromic_substrings/Solution.kt index a21bb2f..9d8d4e0 100644 --- a/src/main/kotlin/g0601_0700/s0647_palindromic_substrings/Solution.kt +++ b/src/main/kotlin/g0601_0700/s0647_palindromic_substrings/Solution.kt @@ -1,4 +1,4 @@ -package g0601_0700.s0647_palindromic_substrings; +package g0601_0700.s0647_palindromic_substrings // #Medium #Top_100_Liked_Questions #String #Dynamic_Programming #Big_O_Time_O(n^2)_Space_O(n) diff --git a/src/main/kotlin/g0701_0800/s0739_daily_temperatures/Solution.kt b/src/main/kotlin/g0701_0800/s0739_daily_temperatures/Solution.kt index 29ed3ea..ceac072 100644 --- a/src/main/kotlin/g0701_0800/s0739_daily_temperatures/Solution.kt +++ b/src/main/kotlin/g0701_0800/s0739_daily_temperatures/Solution.kt @@ -1,4 +1,4 @@ -package g0701_0800.s0739_daily_temperatures; +package g0701_0800.s0739_daily_temperatures // #Medium #Top_100_Liked_Questions #Array #Stack #Monotonic_Stack #Programming_Skills_II_Day_6 // #Big_O_Time_O(n)_Space_O(n) diff --git a/src/main/kotlin/g0701_0800/s0763_partition_labels/Solution.kt b/src/main/kotlin/g0701_0800/s0763_partition_labels/Solution.kt index 3e68f02..52a1203 100644 --- a/src/main/kotlin/g0701_0800/s0763_partition_labels/Solution.kt +++ b/src/main/kotlin/g0701_0800/s0763_partition_labels/Solution.kt @@ -1,4 +1,4 @@ -package g0701_0800.s0763_partition_labels; +package g0701_0800.s0763_partition_labels // #Medium #Top_100_Liked_Questions #String #Hash_Table #Greedy #Two_Pointers // #Data_Structure_II_Day_7_String #Big_O_Time_O(n)_Space_O(1) diff --git a/src/main/kotlin/g1101_1200/s1143_longest_common_subsequence/Solution.kt b/src/main/kotlin/g1101_1200/s1143_longest_common_subsequence/Solution.kt index 53281f3..9318086 100644 --- a/src/main/kotlin/g1101_1200/s1143_longest_common_subsequence/Solution.kt +++ b/src/main/kotlin/g1101_1200/s1143_longest_common_subsequence/Solution.kt @@ -1,4 +1,4 @@ -package g1101_1200.s1143_longest_common_subsequence; +package g1101_1200.s1143_longest_common_subsequence // #Medium #Top_100_Liked_Questions #String #Dynamic_Programming // #Algorithm_II_Day_17_Dynamic_Programming #Dynamic_Programming_I_Day_19