From 6da9b5778631694631a34d3e3d17dfdcb4e8e3a2 Mon Sep 17 00:00:00 2001 From: Pranav Mathur <72330781+DARKcoder37@users.noreply.github.com> Date: Sun, 26 Feb 2023 18:26:02 +0530 Subject: [PATCH 01/34] Delete 1) 2 sum (easy) --- 1) 2 sum (easy) | 1 - 1 file changed, 1 deletion(-) delete mode 100644 1) 2 sum (easy) diff --git a/1) 2 sum (easy) b/1) 2 sum (easy) deleted file mode 100644 index 8b13789..0000000 --- a/1) 2 sum (easy) +++ /dev/null @@ -1 +0,0 @@ - From 0cbce1cfd640475ca77134a8ae07f068ccac0d45 Mon Sep 17 00:00:00 2001 From: Pranav Mathur <72330781+DARKcoder37@users.noreply.github.com> Date: Sun, 26 Feb 2023 18:26:11 +0530 Subject: [PATCH 02/34] Delete 2) Add two numbers (medium) --- 2) Add two numbers (medium) | 1 - 1 file changed, 1 deletion(-) delete mode 100644 2) Add two numbers (medium) diff --git a/2) Add two numbers (medium) b/2) Add two numbers (medium) deleted file mode 100644 index 8b13789..0000000 --- a/2) Add two numbers (medium) +++ /dev/null @@ -1 +0,0 @@ - From 0bee04869f94021ed7a9f8363e5b3e98384a6dff Mon Sep 17 00:00:00 2001 From: Pranav Mathur <72330781+DARKcoder37@users.noreply.github.com> Date: Sun, 26 Feb 2023 18:27:12 +0530 Subject: [PATCH 03/34] Add files via upload --- 1) 2 sum (easy)/2 sum cpp.md | 46 +++++++++++++++++++++++++++++++++ 1) 2 sum (easy)/2 sum python.md | 12 +++++++++ 2 files changed, 58 insertions(+) create mode 100644 1) 2 sum (easy)/2 sum cpp.md create mode 100644 1) 2 sum (easy)/2 sum python.md diff --git a/1) 2 sum (easy)/2 sum cpp.md b/1) 2 sum (easy)/2 sum cpp.md new file mode 100644 index 0000000..ee74d31 --- /dev/null +++ b/1) 2 sum (easy)/2 sum cpp.md @@ -0,0 +1,46 @@ +C++ + +1) Brute Force +class Solution { +public: + vector twoSum(vector& nums, int target) { + vector ret; + int size = nums.size(); + for(int i=0 ; i < size - 1 ;i++) + { + for(int j = i+1 ; j twoSum(vector& nums, int target) { + vector ret; + int size = nums.size(); + int diff; + unordered_mapm; + for (int i=0 ; i second != i ) + { + ret.push_back(i); + ret.push_back(m.find(diff) -> second); + return ret; + } + m[nums[i]] = i; + } + return ret; + } +}; //O(n) \ No newline at end of file diff --git a/1) 2 sum (easy)/2 sum python.md b/1) 2 sum (easy)/2 sum python.md new file mode 100644 index 0000000..0fc8fe3 --- /dev/null +++ b/1) 2 sum (easy)/2 sum python.md @@ -0,0 +1,12 @@ +Python + +1) Brute force +class Solution(object): + def twoSum(self, nums, target): + #Using Two pointers P1 and P2 to represent every possible pairs of the array. + for p1 in range(len(nums)): + for p2 in range(p1+1, len(nums)): + #If one of those pairs add together equal to the target return the answer else return None. + if nums[p1] + nums[p2] == target: + return [p1, p2] + return 'None' \ No newline at end of file From cf1ba6a179b29169eac1a7e66b2d36f77ef7f487 Mon Sep 17 00:00:00 2001 From: Pranav Mathur <72330781+DARKcoder37@users.noreply.github.com> Date: Sun, 26 Feb 2023 18:29:06 +0530 Subject: [PATCH 04/34] Rename 2 sum python.md to 2 sum python.py --- 1) 2 sum (easy)/{2 sum python.md => 2 sum python.py} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename 1) 2 sum (easy)/{2 sum python.md => 2 sum python.py} (92%) diff --git a/1) 2 sum (easy)/2 sum python.md b/1) 2 sum (easy)/2 sum python.py similarity index 92% rename from 1) 2 sum (easy)/2 sum python.md rename to 1) 2 sum (easy)/2 sum python.py index 0fc8fe3..4eca4a6 100644 --- a/1) 2 sum (easy)/2 sum python.md +++ b/1) 2 sum (easy)/2 sum python.py @@ -9,4 +9,4 @@ def twoSum(self, nums, target): #If one of those pairs add together equal to the target return the answer else return None. if nums[p1] + nums[p2] == target: return [p1, p2] - return 'None' \ No newline at end of file + return 'None' From 4b80b8a0661c705b2764788979b81216ecb84b21 Mon Sep 17 00:00:00 2001 From: Pranav Mathur <72330781+DARKcoder37@users.noreply.github.com> Date: Sun, 26 Feb 2023 18:29:37 +0530 Subject: [PATCH 05/34] Rename 2 sum cpp.md to 2 sum cpp.cpp --- 1) 2 sum (easy)/{2 sum cpp.md => 2 sum cpp.cpp} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename 1) 2 sum (easy)/{2 sum cpp.md => 2 sum cpp.cpp} (95%) diff --git a/1) 2 sum (easy)/2 sum cpp.md b/1) 2 sum (easy)/2 sum cpp.cpp similarity index 95% rename from 1) 2 sum (easy)/2 sum cpp.md rename to 1) 2 sum (easy)/2 sum cpp.cpp index ee74d31..b2de3cd 100644 --- a/1) 2 sum (easy)/2 sum cpp.md +++ b/1) 2 sum (easy)/2 sum cpp.cpp @@ -43,4 +43,4 @@ class Solution { } return ret; } -}; //O(n) \ No newline at end of file +}; //O(n) From a4ed37ef5c992d235329c0eaab59dd43f872b5df Mon Sep 17 00:00:00 2001 From: Pranav Mathur <72330781+DARKcoder37@users.noreply.github.com> Date: Sun, 26 Feb 2023 18:30:18 +0530 Subject: [PATCH 06/34] Update 2 sum cpp.cpp --- 1) 2 sum (easy)/2 sum cpp.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/1) 2 sum (easy)/2 sum cpp.cpp b/1) 2 sum (easy)/2 sum cpp.cpp index b2de3cd..257985e 100644 --- a/1) 2 sum (easy)/2 sum cpp.cpp +++ b/1) 2 sum (easy)/2 sum cpp.cpp @@ -1,6 +1,6 @@ C++ -1) Brute Force +1) Brute Force [O(n^2)] class Solution { public: vector twoSum(vector& nums, int target) { @@ -20,9 +20,9 @@ class Solution { } return ret; } -}; //O(n^2) +}; -2) Hash Table +2) Hash Table [O(n)] class Solution { public: vector twoSum(vector& nums, int target) { @@ -43,4 +43,4 @@ class Solution { } return ret; } -}; //O(n) +}; From f88305f55682abd966133aa2d4547729c57e182e Mon Sep 17 00:00:00 2001 From: Pranav Mathur <72330781+DARKcoder37@users.noreply.github.com> Date: Tue, 11 Apr 2023 22:34:31 +0530 Subject: [PATCH 07/34] Create 2390. Removing Stars From a String --- .../2390. Removing Stars From a String | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Daily Challenge/2390. Removing Stars From a String diff --git a/Daily Challenge/2390. Removing Stars From a String b/Daily Challenge/2390. Removing Stars From a String new file mode 100644 index 0000000..f63f5d6 --- /dev/null +++ b/Daily Challenge/2390. Removing Stars From a String @@ -0,0 +1,36 @@ +2390. Removing Stars From a String (Medium) +You are given a string s, which contains stars *. + +In one operation, you can: + +Choose a star in s. +Remove the closest non-star character to its left, as well as remove the star itself. +Return the string after all stars have been removed. + +Note: + +The input will be generated such that the operation is always possible. +It can be shown that the resulting string will always be unique. + + +Example 1: + +Input: s = "leet**cod*e" +Output: "lecoe" +Explanation: Performing the removals from left to right: +- The closest character to the 1st star is 't' in "leet**cod*e". s becomes "lee*cod*e". +- The closest character to the 2nd star is 'e' in "lee*cod*e". s becomes "lecod*e". +- The closest character to the 3rd star is 'd' in "lecod*e". s becomes "lecoe". +There are no more stars, so we return "lecoe". +Example 2: + +Input: s = "erase*****" +Output: "" +Explanation: The entire string is removed, so we return an empty string. + + +Constraints: + +1 <= s.length <= 105 +s consists of lowercase English letters and stars *. +The operation above can be performed on s. From 94e0cdb6debff6f738973d1a542d276beb2c26ac Mon Sep 17 00:00:00 2001 From: Pranav Mathur <72330781+DARKcoder37@users.noreply.github.com> Date: Tue, 11 Apr 2023 22:35:26 +0530 Subject: [PATCH 08/34] Delete 2390. Removing Stars From a String --- .../2390. Removing Stars From a String | 36 ------------------- 1 file changed, 36 deletions(-) delete mode 100644 Daily Challenge/2390. Removing Stars From a String diff --git a/Daily Challenge/2390. Removing Stars From a String b/Daily Challenge/2390. Removing Stars From a String deleted file mode 100644 index f63f5d6..0000000 --- a/Daily Challenge/2390. Removing Stars From a String +++ /dev/null @@ -1,36 +0,0 @@ -2390. Removing Stars From a String (Medium) -You are given a string s, which contains stars *. - -In one operation, you can: - -Choose a star in s. -Remove the closest non-star character to its left, as well as remove the star itself. -Return the string after all stars have been removed. - -Note: - -The input will be generated such that the operation is always possible. -It can be shown that the resulting string will always be unique. - - -Example 1: - -Input: s = "leet**cod*e" -Output: "lecoe" -Explanation: Performing the removals from left to right: -- The closest character to the 1st star is 't' in "leet**cod*e". s becomes "lee*cod*e". -- The closest character to the 2nd star is 'e' in "lee*cod*e". s becomes "lecod*e". -- The closest character to the 3rd star is 'd' in "lecod*e". s becomes "lecoe". -There are no more stars, so we return "lecoe". -Example 2: - -Input: s = "erase*****" -Output: "" -Explanation: The entire string is removed, so we return an empty string. - - -Constraints: - -1 <= s.length <= 105 -s consists of lowercase English letters and stars *. -The operation above can be performed on s. From 4baccd84e26965703e3323e0bb9973ef0973a82f Mon Sep 17 00:00:00 2001 From: Pranav Mathur <72330781+DARKcoder37@users.noreply.github.com> Date: Tue, 11 Apr 2023 22:37:24 +0530 Subject: [PATCH 09/34] Add files via upload --- .../2390. Removing Stars From a String.md | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 Daily Challenge/2390. Removing Stars From a String.md diff --git a/Daily Challenge/2390. Removing Stars From a String.md b/Daily Challenge/2390. Removing Stars From a String.md new file mode 100644 index 0000000..13d8e50 --- /dev/null +++ b/Daily Challenge/2390. Removing Stars From a String.md @@ -0,0 +1,37 @@ +2390. Removing Stars From a String(Medium) + +You are given a string s, which contains stars *. + +In one operation, you can: + +Choose a star in s. +Remove the closest non-star character to its left, as well as remove the star itself. +Return the string after all stars have been removed. + +Note: + +The input will be generated such that the operation is always possible. +It can be shown that the resulting string will always be unique. + + +Example 1: + +Input: s = "leet**cod*e" +Output: "lecoe" +Explanation: Performing the removals from left to right: +- The closest character to the 1st star is 't' in "leet**cod*e". s becomes "lee*cod*e". +- The closest character to the 2nd star is 'e' in "lee*cod*e". s becomes "lecod*e". +- The closest character to the 3rd star is 'd' in "lecod*e". s becomes "lecoe". +There are no more stars, so we return "lecoe". +Example 2: + +Input: s = "erase*****" +Output: "" +Explanation: The entire string is removed, so we return an empty string. + + +Constraints: + +1 <= s.length <= 105 +s consists of lowercase English letters and stars *. +The operation above can be performed on s. \ No newline at end of file From a34739d094c474f3dc63b03c4324df9fc69ee23b Mon Sep 17 00:00:00 2001 From: Pranav Mathur <72330781+DARKcoder37@users.noreply.github.com> Date: Tue, 11 Apr 2023 22:37:54 +0530 Subject: [PATCH 10/34] Delete Daily Challenge directory --- .../2390. Removing Stars From a String.md | 37 ------------------- 1 file changed, 37 deletions(-) delete mode 100644 Daily Challenge/2390. Removing Stars From a String.md diff --git a/Daily Challenge/2390. Removing Stars From a String.md b/Daily Challenge/2390. Removing Stars From a String.md deleted file mode 100644 index 13d8e50..0000000 --- a/Daily Challenge/2390. Removing Stars From a String.md +++ /dev/null @@ -1,37 +0,0 @@ -2390. Removing Stars From a String(Medium) - -You are given a string s, which contains stars *. - -In one operation, you can: - -Choose a star in s. -Remove the closest non-star character to its left, as well as remove the star itself. -Return the string after all stars have been removed. - -Note: - -The input will be generated such that the operation is always possible. -It can be shown that the resulting string will always be unique. - - -Example 1: - -Input: s = "leet**cod*e" -Output: "lecoe" -Explanation: Performing the removals from left to right: -- The closest character to the 1st star is 't' in "leet**cod*e". s becomes "lee*cod*e". -- The closest character to the 2nd star is 'e' in "lee*cod*e". s becomes "lecod*e". -- The closest character to the 3rd star is 'd' in "lecod*e". s becomes "lecoe". -There are no more stars, so we return "lecoe". -Example 2: - -Input: s = "erase*****" -Output: "" -Explanation: The entire string is removed, so we return an empty string. - - -Constraints: - -1 <= s.length <= 105 -s consists of lowercase English letters and stars *. -The operation above can be performed on s. \ No newline at end of file From 27e857ed40f3fd622ae92a9d72e4fc2320a7f835 Mon Sep 17 00:00:00 2001 From: Pranav Mathur <72330781+DARKcoder37@users.noreply.github.com> Date: Tue, 11 Apr 2023 22:43:13 +0530 Subject: [PATCH 11/34] Add files via upload --- .../2390. Removing Stars From a String.md | 37 +++++++++++++++++++ .../2390. Removing Stars From a String/Sol.py | 11 ++++++ 2 files changed, 48 insertions(+) create mode 100644 Daily Challenge/2390. Removing Stars From a String/2390. Removing Stars From a String.md create mode 100644 Daily Challenge/2390. Removing Stars From a String/Sol.py diff --git a/Daily Challenge/2390. Removing Stars From a String/2390. Removing Stars From a String.md b/Daily Challenge/2390. Removing Stars From a String/2390. Removing Stars From a String.md new file mode 100644 index 0000000..13d8e50 --- /dev/null +++ b/Daily Challenge/2390. Removing Stars From a String/2390. Removing Stars From a String.md @@ -0,0 +1,37 @@ +2390. Removing Stars From a String(Medium) + +You are given a string s, which contains stars *. + +In one operation, you can: + +Choose a star in s. +Remove the closest non-star character to its left, as well as remove the star itself. +Return the string after all stars have been removed. + +Note: + +The input will be generated such that the operation is always possible. +It can be shown that the resulting string will always be unique. + + +Example 1: + +Input: s = "leet**cod*e" +Output: "lecoe" +Explanation: Performing the removals from left to right: +- The closest character to the 1st star is 't' in "leet**cod*e". s becomes "lee*cod*e". +- The closest character to the 2nd star is 'e' in "lee*cod*e". s becomes "lecod*e". +- The closest character to the 3rd star is 'd' in "lecod*e". s becomes "lecoe". +There are no more stars, so we return "lecoe". +Example 2: + +Input: s = "erase*****" +Output: "" +Explanation: The entire string is removed, so we return an empty string. + + +Constraints: + +1 <= s.length <= 105 +s consists of lowercase English letters and stars *. +The operation above can be performed on s. \ No newline at end of file diff --git a/Daily Challenge/2390. Removing Stars From a String/Sol.py b/Daily Challenge/2390. Removing Stars From a String/Sol.py new file mode 100644 index 0000000..6cbf6d5 --- /dev/null +++ b/Daily Challenge/2390. Removing Stars From a String/Sol.py @@ -0,0 +1,11 @@ +class Solution: + def removeStars(self, s: str) -> str: + st = [] + for i in s: + if i == '*' and len(st)>0: + st.pop() + else: + st.append(i) + + ans = ''.join(st) + return ans \ No newline at end of file From d2d0fac783bb26812d51411b29b60913b0849970 Mon Sep 17 00:00:00 2001 From: Pranav Mathur <72330781+DARKcoder37@users.noreply.github.com> Date: Tue, 11 Apr 2023 22:49:52 +0530 Subject: [PATCH 12/34] Delete 1) 2 sum (easy) directory --- 1) 2 sum (easy)/2 sum cpp.cpp | 46 --------------------------------- 1) 2 sum (easy)/2 sum python.py | 12 --------- 2 files changed, 58 deletions(-) delete mode 100644 1) 2 sum (easy)/2 sum cpp.cpp delete mode 100644 1) 2 sum (easy)/2 sum python.py diff --git a/1) 2 sum (easy)/2 sum cpp.cpp b/1) 2 sum (easy)/2 sum cpp.cpp deleted file mode 100644 index 257985e..0000000 --- a/1) 2 sum (easy)/2 sum cpp.cpp +++ /dev/null @@ -1,46 +0,0 @@ -C++ - -1) Brute Force [O(n^2)] -class Solution { -public: - vector twoSum(vector& nums, int target) { - vector ret; - int size = nums.size(); - for(int i=0 ; i < size - 1 ;i++) - { - for(int j = i+1 ; j twoSum(vector& nums, int target) { - vector ret; - int size = nums.size(); - int diff; - unordered_mapm; - for (int i=0 ; i second != i ) - { - ret.push_back(i); - ret.push_back(m.find(diff) -> second); - return ret; - } - m[nums[i]] = i; - } - return ret; - } -}; diff --git a/1) 2 sum (easy)/2 sum python.py b/1) 2 sum (easy)/2 sum python.py deleted file mode 100644 index 4eca4a6..0000000 --- a/1) 2 sum (easy)/2 sum python.py +++ /dev/null @@ -1,12 +0,0 @@ -Python - -1) Brute force -class Solution(object): - def twoSum(self, nums, target): - #Using Two pointers P1 and P2 to represent every possible pairs of the array. - for p1 in range(len(nums)): - for p2 in range(p1+1, len(nums)): - #If one of those pairs add together equal to the target return the answer else return None. - if nums[p1] + nums[p2] == target: - return [p1, p2] - return 'None' From 847200fe3563fc1e5aa72364fa7db7a1116bc528 Mon Sep 17 00:00:00 2001 From: Pranav Mathur <72330781+DARKcoder37@users.noreply.github.com> Date: Tue, 11 Apr 2023 22:50:33 +0530 Subject: [PATCH 13/34] Add files via upload --- .../1) 2 sum (easy)/2 sum cpp.txt | 44 +++++++++++++++++++ .../1) 2 sum (easy)/2 sum python.txt | 10 +++++ 2 files changed, 54 insertions(+) create mode 100644 Problem Solution/1) 2 sum (easy)/2 sum cpp.txt create mode 100644 Problem Solution/1) 2 sum (easy)/2 sum python.txt diff --git a/Problem Solution/1) 2 sum (easy)/2 sum cpp.txt b/Problem Solution/1) 2 sum (easy)/2 sum cpp.txt new file mode 100644 index 0000000..f7fa4eb --- /dev/null +++ b/Problem Solution/1) 2 sum (easy)/2 sum cpp.txt @@ -0,0 +1,44 @@ +1) Brute Force [O(n^2)] +class Solution { +public: + vector twoSum(vector& nums, int target) { + vector ret; + int size = nums.size(); + for(int i=0 ; i < size - 1 ;i++) + { + for(int j = i+1 ; j twoSum(vector& nums, int target) { + vector ret; + int size = nums.size(); + int diff; + unordered_mapm; + for (int i=0 ; i second != i ) + { + ret.push_back(i); + ret.push_back(m.find(diff) -> second); + return ret; + } + m[nums[i]] = i; + } + return ret; + } +}; \ No newline at end of file diff --git a/Problem Solution/1) 2 sum (easy)/2 sum python.txt b/Problem Solution/1) 2 sum (easy)/2 sum python.txt new file mode 100644 index 0000000..e199158 --- /dev/null +++ b/Problem Solution/1) 2 sum (easy)/2 sum python.txt @@ -0,0 +1,10 @@ +1) Brute force +class Solution(object): + def twoSum(self, nums, target): + #Using Two pointers P1 and P2 to represent every possible pairs of the array. + for p1 in range(len(nums)): + for p2 in range(p1+1, len(nums)): + #If one of those pairs add together equal to the target return the answer else return None. + if nums[p1] + nums[p2] == target: + return [p1, p2] + return 'None' \ No newline at end of file From da58f218c46286abdf303d21745a09b94d377412 Mon Sep 17 00:00:00 2001 From: Pranav Mathur <72330781+DARKcoder37@users.noreply.github.com> Date: Tue, 11 Apr 2023 22:51:17 +0530 Subject: [PATCH 14/34] Rename 2 sum cpp.txt to 2 sum cpp.md --- .../1) 2 sum (easy)/{2 sum cpp.txt => 2 sum cpp.md} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename Problem Solution/1) 2 sum (easy)/{2 sum cpp.txt => 2 sum cpp.md} (95%) diff --git a/Problem Solution/1) 2 sum (easy)/2 sum cpp.txt b/Problem Solution/1) 2 sum (easy)/2 sum cpp.md similarity index 95% rename from Problem Solution/1) 2 sum (easy)/2 sum cpp.txt rename to Problem Solution/1) 2 sum (easy)/2 sum cpp.md index f7fa4eb..294a1f4 100644 --- a/Problem Solution/1) 2 sum (easy)/2 sum cpp.txt +++ b/Problem Solution/1) 2 sum (easy)/2 sum cpp.md @@ -41,4 +41,4 @@ public: } return ret; } -}; \ No newline at end of file +}; From bb412bb6db84f99c02c4599cbd07d9b42637e4e2 Mon Sep 17 00:00:00 2001 From: Pranav Mathur <72330781+DARKcoder37@users.noreply.github.com> Date: Tue, 11 Apr 2023 22:51:34 +0530 Subject: [PATCH 15/34] Rename 2 sum cpp.md to 2 sum cpp.cpp --- Problem Solution/1) 2 sum (easy)/{2 sum cpp.md => 2 sum cpp.cpp} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Problem Solution/1) 2 sum (easy)/{2 sum cpp.md => 2 sum cpp.cpp} (100%) diff --git a/Problem Solution/1) 2 sum (easy)/2 sum cpp.md b/Problem Solution/1) 2 sum (easy)/2 sum cpp.cpp similarity index 100% rename from Problem Solution/1) 2 sum (easy)/2 sum cpp.md rename to Problem Solution/1) 2 sum (easy)/2 sum cpp.cpp From b132ca5c60c2d72474269afe75ef0bf1d85171e4 Mon Sep 17 00:00:00 2001 From: Pranav Mathur <72330781+DARKcoder37@users.noreply.github.com> Date: Tue, 11 Apr 2023 22:52:20 +0530 Subject: [PATCH 16/34] Rename 2 sum python.txt to 2 sum python.py --- .../1) 2 sum (easy)/{2 sum python.txt => 2 sum python.py} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename Problem Solution/1) 2 sum (easy)/{2 sum python.txt => 2 sum python.py} (93%) diff --git a/Problem Solution/1) 2 sum (easy)/2 sum python.txt b/Problem Solution/1) 2 sum (easy)/2 sum python.py similarity index 93% rename from Problem Solution/1) 2 sum (easy)/2 sum python.txt rename to Problem Solution/1) 2 sum (easy)/2 sum python.py index e199158..a90c63d 100644 --- a/Problem Solution/1) 2 sum (easy)/2 sum python.txt +++ b/Problem Solution/1) 2 sum (easy)/2 sum python.py @@ -7,4 +7,4 @@ def twoSum(self, nums, target): #If one of those pairs add together equal to the target return the answer else return None. if nums[p1] + nums[p2] == target: return [p1, p2] - return 'None' \ No newline at end of file + return 'None' From 142c2f541feafadc1c6b54e42f79aef6d6a21a7f Mon Sep 17 00:00:00 2001 From: Pranav Mathur <72330781+DARKcoder37@users.noreply.github.com> Date: Tue, 11 Apr 2023 22:55:50 +0530 Subject: [PATCH 17/34] Add files via upload --- .../1) 2 sum (easy)/2 sum problem.txt | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Problem Solution/1) 2 sum (easy)/2 sum problem.txt diff --git a/Problem Solution/1) 2 sum (easy)/2 sum problem.txt b/Problem Solution/1) 2 sum (easy)/2 sum problem.txt new file mode 100644 index 0000000..fc7be0b --- /dev/null +++ b/Problem Solution/1) 2 sum (easy)/2 sum problem.txt @@ -0,0 +1,31 @@ +1. Two Sum (Easy) + +Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. + +You may assume that each input would have exactly one solution, and you may not use the same element twice. + +You can return the answer in any order. + + + +Example 1: + +Input: nums = [2,7,11,15], target = 9 +Output: [0,1] +Explanation: Because nums[0] + nums[1] == 9, we return [0, 1]. +Example 2: + +Input: nums = [3,2,4], target = 6 +Output: [1,2] +Example 3: + +Input: nums = [3,3], target = 6 +Output: [0,1] + + +Constraints: + +2 <= nums.length <= 104 +-109 <= nums[i] <= 109 +-109 <= target <= 109 +Only one valid answer exists. \ No newline at end of file From 1fefda76afb3640492b8bce29462456889fbdf03 Mon Sep 17 00:00:00 2001 From: Pranav Mathur <72330781+DARKcoder37@users.noreply.github.com> Date: Wed, 12 Apr 2023 19:24:28 +0530 Subject: [PATCH 18/34] Add files via upload --- .../71. Simplify Path/71. Simplify Path.md | 0 Daily Challenge/71. Simplify Path/sol.py | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 Daily Challenge/71. Simplify Path/71. Simplify Path.md create mode 100644 Daily Challenge/71. Simplify Path/sol.py diff --git a/Daily Challenge/71. Simplify Path/71. Simplify Path.md b/Daily Challenge/71. Simplify Path/71. Simplify Path.md new file mode 100644 index 0000000..e69de29 diff --git a/Daily Challenge/71. Simplify Path/sol.py b/Daily Challenge/71. Simplify Path/sol.py new file mode 100644 index 0000000..2a73f81 --- /dev/null +++ b/Daily Challenge/71. Simplify Path/sol.py @@ -0,0 +1,19 @@ +class Solution: + def simplifyPath(self, path: str) -> str: + path = path.split('/') + print(path) + stack = [] + for c in path: + if c: + if c == '.': + continue + elif c == '..': + if stack: + stack.pop() + else: + continue + else: + stack.append(c) + + + return '/'+'/'.join(stack) From d62c6c075cbd4191f875f0d88b59ab0620d6ebe1 Mon Sep 17 00:00:00 2001 From: Pranav Mathur <72330781+DARKcoder37@users.noreply.github.com> Date: Wed, 12 Apr 2023 19:25:59 +0530 Subject: [PATCH 19/34] Delete 71. Simplify Path.md --- Daily Challenge/71. Simplify Path/71. Simplify Path.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 Daily Challenge/71. Simplify Path/71. Simplify Path.md diff --git a/Daily Challenge/71. Simplify Path/71. Simplify Path.md b/Daily Challenge/71. Simplify Path/71. Simplify Path.md deleted file mode 100644 index e69de29..0000000 From f90f3f8496af2dfd7cec9fb8c16ad386b60938c0 Mon Sep 17 00:00:00 2001 From: Pranav Mathur <72330781+DARKcoder37@users.noreply.github.com> Date: Wed, 12 Apr 2023 19:26:20 +0530 Subject: [PATCH 20/34] Add files via upload --- .../71. Simplify Path/71. Simplify Path.md | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Daily Challenge/71. Simplify Path/71. Simplify Path.md diff --git a/Daily Challenge/71. Simplify Path/71. Simplify Path.md b/Daily Challenge/71. Simplify Path/71. Simplify Path.md new file mode 100644 index 0000000..cb9c1c8 --- /dev/null +++ b/Daily Challenge/71. Simplify Path/71. Simplify Path.md @@ -0,0 +1,38 @@ +71. Simplify Path(Medium) + +Given a string path, which is an absolute path (starting with a slash '/') to a file or directory in a Unix-style file system, convert it to the simplified canonical path. + +In a Unix-style file system, a period '.' refers to the current directory, a double period '..' refers to the directory up a level, and any multiple consecutive slashes (i.e. '//') are treated as a single slash '/'. For this problem, any other format of periods such as '...' are treated as file/directory names. + +The canonical path should have the following format: + +The path starts with a single slash '/'. +Any two directories are separated by a single slash '/'. +The path does not end with a trailing '/'. +The path only contains the directories on the path from the root directory to the target file or directory (i.e., no period '.' or double period '..') +Return the simplified canonical path. + + + +Example 1: + +Input: path = "/home/" +Output: "/home" +Explanation: Note that there is no trailing slash after the last directory name. +Example 2: + +Input: path = "/../" +Output: "/" +Explanation: Going one level up from the root directory is a no-op, as the root level is the highest level you can go. +Example 3: + +Input: path = "/home//foo/" +Output: "/home/foo" +Explanation: In the canonical path, multiple consecutive slashes are replaced by a single one. + + +Constraints: + +1 <= path.length <= 3000 +path consists of English letters, digits, period '.', slash '/' or '_'. +path is a valid absolute Unix path. \ No newline at end of file From 3ac39d03ec9b6ac25a3a8badab289fcefb490731 Mon Sep 17 00:00:00 2001 From: Pranav Mathur <72330781+DARKcoder37@users.noreply.github.com> Date: Wed, 12 Apr 2023 19:27:12 +0530 Subject: [PATCH 21/34] Rename 71. Simplify Path.md to 71. Simplify Path.txt --- .../{71. Simplify Path.md => 71. Simplify Path.txt} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename Daily Challenge/71. Simplify Path/{71. Simplify Path.md => 71. Simplify Path.txt} (95%) diff --git a/Daily Challenge/71. Simplify Path/71. Simplify Path.md b/Daily Challenge/71. Simplify Path/71. Simplify Path.txt similarity index 95% rename from Daily Challenge/71. Simplify Path/71. Simplify Path.md rename to Daily Challenge/71. Simplify Path/71. Simplify Path.txt index cb9c1c8..bbd3fa9 100644 --- a/Daily Challenge/71. Simplify Path/71. Simplify Path.md +++ b/Daily Challenge/71. Simplify Path/71. Simplify Path.txt @@ -35,4 +35,4 @@ Constraints: 1 <= path.length <= 3000 path consists of English letters, digits, period '.', slash '/' or '_'. -path is a valid absolute Unix path. \ No newline at end of file +path is a valid absolute Unix path. From fa20ca77c2c2d039831ba6858f8f439dae222ccb Mon Sep 17 00:00:00 2001 From: Pranav Mathur <72330781+DARKcoder37@users.noreply.github.com> Date: Wed, 12 Apr 2023 19:27:45 +0530 Subject: [PATCH 22/34] Rename 2390. Removing Stars From a String.md to 2390. Removing Stars From a String.txt --- ... From a String.md => 2390. Removing Stars From a String.txt} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename Daily Challenge/2390. Removing Stars From a String/{2390. Removing Stars From a String.md => 2390. Removing Stars From a String.txt} (92%) diff --git a/Daily Challenge/2390. Removing Stars From a String/2390. Removing Stars From a String.md b/Daily Challenge/2390. Removing Stars From a String/2390. Removing Stars From a String.txt similarity index 92% rename from Daily Challenge/2390. Removing Stars From a String/2390. Removing Stars From a String.md rename to Daily Challenge/2390. Removing Stars From a String/2390. Removing Stars From a String.txt index 13d8e50..490abe2 100644 --- a/Daily Challenge/2390. Removing Stars From a String/2390. Removing Stars From a String.md +++ b/Daily Challenge/2390. Removing Stars From a String/2390. Removing Stars From a String.txt @@ -34,4 +34,4 @@ Constraints: 1 <= s.length <= 105 s consists of lowercase English letters and stars *. -The operation above can be performed on s. \ No newline at end of file +The operation above can be performed on s. From 3582b3ff83a76c493ab6a7a2170f4e9e477ddbde Mon Sep 17 00:00:00 2001 From: Pranav Mathur <72330781+DARKcoder37@users.noreply.github.com> Date: Wed, 12 Apr 2023 19:30:56 +0530 Subject: [PATCH 23/34] Add files via upload --- .../Add two numbers.txt | 29 +++++++++++++++++++ .../2) Add two number (medium)/sol.py | 18 ++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 Problem Solution/2) Add two number (medium)/Add two numbers.txt create mode 100644 Problem Solution/2) Add two number (medium)/sol.py diff --git a/Problem Solution/2) Add two number (medium)/Add two numbers.txt b/Problem Solution/2) Add two number (medium)/Add two numbers.txt new file mode 100644 index 0000000..bc1e447 --- /dev/null +++ b/Problem Solution/2) Add two number (medium)/Add two numbers.txt @@ -0,0 +1,29 @@ +2. Add Two Numbers (Medium) + +You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a single digit. Add the two numbers and return the sum as a linked list. + +You may assume the two numbers do not contain any leading zero, except the number 0 itself. + + + +Example 1: + + +Input: l1 = [2,4,3], l2 = [5,6,4] +Output: [7,0,8] +Explanation: 342 + 465 = 807. +Example 2: + +Input: l1 = [0], l2 = [0] +Output: [0] +Example 3: + +Input: l1 = [9,9,9,9,9,9,9], l2 = [9,9,9,9] +Output: [8,9,9,9,0,0,0,1] + + +Constraints: + +The number of nodes in each linked list is in the range [1, 100]. +0 <= Node.val <= 9 +It is guaranteed that the list represents a number that does not have leading zeros. \ No newline at end of file diff --git a/Problem Solution/2) Add two number (medium)/sol.py b/Problem Solution/2) Add two number (medium)/sol.py new file mode 100644 index 0000000..1e7de7f --- /dev/null +++ b/Problem Solution/2) Add two number (medium)/sol.py @@ -0,0 +1,18 @@ +class Solution: + def addTwoNumbers(self, l1: ListNode, l2: ListNode) -> ListNode: + dummy = ListNode(0) + curr = dummy + carry = 0 + + while carry or l1 or l2: + if l1: + carry += l1.val + l1 = l1.next + if l2: + carry += l2.val + l2 = l2.next + curr.next = ListNode(carry % 10) + carry //= 10 + curr = curr.next + + return dummy.next \ No newline at end of file From edfa088a05ee254db9010639dc6654055da2832f Mon Sep 17 00:00:00 2001 From: Pranav Mathur <72330781+DARKcoder37@users.noreply.github.com> Date: Thu, 13 Apr 2023 18:06:14 +0530 Subject: [PATCH 24/34] Add files via upload --- .../946. Validate Stack Sequences.txt | 29 +++++++++++++++++++ .../946. Validate Stack Sequences/sol.py | 12 ++++++++ 2 files changed, 41 insertions(+) create mode 100644 Daily Challenge/946. Validate Stack Sequences/946. Validate Stack Sequences.txt create mode 100644 Daily Challenge/946. Validate Stack Sequences/sol.py diff --git a/Daily Challenge/946. Validate Stack Sequences/946. Validate Stack Sequences.txt b/Daily Challenge/946. Validate Stack Sequences/946. Validate Stack Sequences.txt new file mode 100644 index 0000000..eb63811 --- /dev/null +++ b/Daily Challenge/946. Validate Stack Sequences/946. Validate Stack Sequences.txt @@ -0,0 +1,29 @@ +946. Validate Stack Sequences(Medium) + +Given two integer arrays pushed and popped each with distinct values, return true if this could have been the result of a sequence of push and pop operations on an initially empty stack, or false otherwise. + + + +Example 1: + +Input: pushed = [1,2,3,4,5], popped = [4,5,3,2,1] +Output: true +Explanation: We might do the following sequence: +push(1), push(2), push(3), push(4), +pop() -> 4, +push(5), +pop() -> 5, pop() -> 3, pop() -> 2, pop() -> 1 +Example 2: + +Input: pushed = [1,2,3,4,5], popped = [4,3,5,1,2] +Output: false +Explanation: 1 cannot be popped before 2. + + +Constraints: + +1 <= pushed.length <= 1000 +0 <= pushed[i] <= 1000 +All the elements of pushed are unique. +popped.length == pushed.length +popped is a permutation of pushed. \ No newline at end of file diff --git a/Daily Challenge/946. Validate Stack Sequences/sol.py b/Daily Challenge/946. Validate Stack Sequences/sol.py new file mode 100644 index 0000000..1e076d9 --- /dev/null +++ b/Daily Challenge/946. Validate Stack Sequences/sol.py @@ -0,0 +1,12 @@ +class Solution: + def validateStackSequences(self, pushed: List[int], popped: List[int]) -> bool: + stack = [] + i = 0 # popped's index + + for x in pushed: + stack.append(x) + while stack and stack[-1] == popped[i]: + stack.pop() + i += 1 + + return not stack From 734b65b3ddeca5b6c275221f46fac667c97c357f Mon Sep 17 00:00:00 2001 From: Pranav Mathur <72330781+DARKcoder37@users.noreply.github.com> Date: Thu, 13 Apr 2023 18:06:37 +0530 Subject: [PATCH 25/34] Update 946. Validate Stack Sequences.txt --- .../946. Validate Stack Sequences.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Daily Challenge/946. Validate Stack Sequences/946. Validate Stack Sequences.txt b/Daily Challenge/946. Validate Stack Sequences/946. Validate Stack Sequences.txt index eb63811..c591f6c 100644 --- a/Daily Challenge/946. Validate Stack Sequences/946. Validate Stack Sequences.txt +++ b/Daily Challenge/946. Validate Stack Sequences/946. Validate Stack Sequences.txt @@ -1,6 +1,7 @@ 946. Validate Stack Sequences(Medium) -Given two integer arrays pushed and popped each with distinct values, return true if this could have been the result of a sequence of push and pop operations on an initially empty stack, or false otherwise. +Given two integer arrays pushed and popped each with distinct values, return true if this could have been the result of a sequence of +push and pop operations on an initially empty stack, or false otherwise. @@ -26,4 +27,4 @@ Constraints: 0 <= pushed[i] <= 1000 All the elements of pushed are unique. popped.length == pushed.length -popped is a permutation of pushed. \ No newline at end of file +popped is a permutation of pushed. From edb55fe3266ab30ce150f3626709661139c75df8 Mon Sep 17 00:00:00 2001 From: Pranav Mathur <72330781+DARKcoder37@users.noreply.github.com> Date: Thu, 13 Apr 2023 18:11:07 +0530 Subject: [PATCH 26/34] Add files via upload --- ...Substring Without Repeating Characters.txt | 30 +++++++++++++++++++ .../sol.py | 14 +++++++++ 2 files changed, 44 insertions(+) create mode 100644 Problem Solution/3) Longest Substring Without Repeating Characters/Longest Substring Without Repeating Characters.txt create mode 100644 Problem Solution/3) Longest Substring Without Repeating Characters/sol.py diff --git a/Problem Solution/3) Longest Substring Without Repeating Characters/Longest Substring Without Repeating Characters.txt b/Problem Solution/3) Longest Substring Without Repeating Characters/Longest Substring Without Repeating Characters.txt new file mode 100644 index 0000000..ad85ada --- /dev/null +++ b/Problem Solution/3) Longest Substring Without Repeating Characters/Longest Substring Without Repeating Characters.txt @@ -0,0 +1,30 @@ +3. Longest Substring Without Repeating Characters(Medium) + +Given a string s, find the length of the longest +substring + without repeating characters. + + + +Example 1: + +Input: s = "abcabcbb" +Output: 3 +Explanation: The answer is "abc", with the length of 3. +Example 2: + +Input: s = "bbbbb" +Output: 1 +Explanation: The answer is "b", with the length of 1. +Example 3: + +Input: s = "pwwkew" +Output: 3 +Explanation: The answer is "wke", with the length of 3. +Notice that the answer must be a substring, "pwke" is a subsequence and not a substring. + + +Constraints: + +0 <= s.length <= 5 * 104 +s consists of English letters, digits, symbols and spaces. \ No newline at end of file diff --git a/Problem Solution/3) Longest Substring Without Repeating Characters/sol.py b/Problem Solution/3) Longest Substring Without Repeating Characters/sol.py new file mode 100644 index 0000000..3a0c87e --- /dev/null +++ b/Problem Solution/3) Longest Substring Without Repeating Characters/sol.py @@ -0,0 +1,14 @@ +class Solution: + def lengthOfLongestSubstring(self, s: str) -> int: + ans = 0 + count = collections.Counter() + + l = 0 + for r, c in enumerate(s): + count[c] += 1 + while count[c] > 1: + count[s[l]] -= 1 + l += 1 + ans = max(ans, r - l + 1) + + return ans \ No newline at end of file From fd7eb825222207fc00a82e3957ca4f5673aa80a2 Mon Sep 17 00:00:00 2001 From: Pranav Mathur <72330781+DARKcoder37@users.noreply.github.com> Date: Fri, 14 Apr 2023 21:12:03 +0530 Subject: [PATCH 27/34] Add files via upload --- .../README.md | 24 ++++++++++++ .../sol.py | 37 +++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 Daily Challenge/516. Longest Palindromic Subsequence/README.md create mode 100644 Daily Challenge/516. Longest Palindromic Subsequence/sol.py diff --git a/Daily Challenge/516. Longest Palindromic Subsequence/README.md b/Daily Challenge/516. Longest Palindromic Subsequence/README.md new file mode 100644 index 0000000..8ca6c83 --- /dev/null +++ b/Daily Challenge/516. Longest Palindromic Subsequence/README.md @@ -0,0 +1,24 @@ +516. Longest Palindromic Subsequence(Medium) + +Given a string s, find the longest palindromic subsequence's length in s. + +A subsequence is a sequence that can be derived from another sequence by deleting some or no elements without changing the order of the remaining elements. + + + +Example 1: + +Input: s = "bbbab" +Output: 4 +Explanation: One possible longest palindromic subsequence is "bbbb". +Example 2: + +Input: s = "cbbd" +Output: 2 +Explanation: One possible longest palindromic subsequence is "bb". + + +Constraints: + +1 <= s.length <= 1000 +s consists only of lowercase English letters. \ No newline at end of file diff --git a/Daily Challenge/516. Longest Palindromic Subsequence/sol.py b/Daily Challenge/516. Longest Palindromic Subsequence/sol.py new file mode 100644 index 0000000..c10fd0b --- /dev/null +++ b/Daily Challenge/516. Longest Palindromic Subsequence/sol.py @@ -0,0 +1,37 @@ +# 1) Top down + +class Solution: + def longestPalindromeSubseq(self, s: str) -> int: + # dp(i, j) := LPS's length in s[i..j] + @functools.lru_cache(None) + def dp(i: int, j: int) -> int: + if i > j: + return 0 + if i == j: + return 1 + if s[i] == s[j]: + return 2 + dp(i + 1, j - 1) + return max(dp(i + 1, j), dp(i, j - 1)) + + return dp(0, len(s) - 1) + +# 2) Bottom up + +class Solution: + def longestPalindromeSubseq(self, s: str) -> int: + n = len(s) + # dp[i][j] := LPS's length in s[i..j] + dp = [[0] * n for _ in range(n)] + + for i in range(n): + dp[i][i] = 1 + + for d in range(1, n): + for i in range(n - d): + j = i + d + if s[i] == s[j]: + dp[i][j] = 2 + dp[i + 1][j - 1] + else: + dp[i][j] = max(dp[i + 1][j], dp[i][j - 1]) + + return dp[0][n - 1] \ No newline at end of file From eaed8170adef88c58242754fd3a520448644cf84 Mon Sep 17 00:00:00 2001 From: Pranav Mathur <72330781+DARKcoder37@users.noreply.github.com> Date: Fri, 14 Apr 2023 21:12:39 +0530 Subject: [PATCH 28/34] Rename README.md to README.txt --- .../{README.md => README.txt} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename Daily Challenge/516. Longest Palindromic Subsequence/{README.md => README.txt} (88%) diff --git a/Daily Challenge/516. Longest Palindromic Subsequence/README.md b/Daily Challenge/516. Longest Palindromic Subsequence/README.txt similarity index 88% rename from Daily Challenge/516. Longest Palindromic Subsequence/README.md rename to Daily Challenge/516. Longest Palindromic Subsequence/README.txt index 8ca6c83..a58a966 100644 --- a/Daily Challenge/516. Longest Palindromic Subsequence/README.md +++ b/Daily Challenge/516. Longest Palindromic Subsequence/README.txt @@ -21,4 +21,4 @@ Explanation: One possible longest palindromic subsequence is "bb". Constraints: 1 <= s.length <= 1000 -s consists only of lowercase English letters. \ No newline at end of file +s consists only of lowercase English letters. From 2e8e2c8501e553a10061880bc3673c4f28dba30b Mon Sep 17 00:00:00 2001 From: Pranav Mathur <72330781+DARKcoder37@users.noreply.github.com> Date: Fri, 14 Apr 2023 21:13:32 +0530 Subject: [PATCH 29/34] Rename 2390. Removing Stars From a String.txt to README.txt --- .../{2390. Removing Stars From a String.txt => README.txt} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Daily Challenge/2390. Removing Stars From a String/{2390. Removing Stars From a String.txt => README.txt} (100%) diff --git a/Daily Challenge/2390. Removing Stars From a String/2390. Removing Stars From a String.txt b/Daily Challenge/2390. Removing Stars From a String/README.txt similarity index 100% rename from Daily Challenge/2390. Removing Stars From a String/2390. Removing Stars From a String.txt rename to Daily Challenge/2390. Removing Stars From a String/README.txt From 4f0595f27ff38b0fd327cce9abd9023e59cd9189 Mon Sep 17 00:00:00 2001 From: Pranav Mathur <72330781+DARKcoder37@users.noreply.github.com> Date: Fri, 14 Apr 2023 21:14:08 +0530 Subject: [PATCH 30/34] Rename 71. Simplify Path.txt to README.txt --- .../71. Simplify Path/{71. Simplify Path.txt => README.txt} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Daily Challenge/71. Simplify Path/{71. Simplify Path.txt => README.txt} (100%) diff --git a/Daily Challenge/71. Simplify Path/71. Simplify Path.txt b/Daily Challenge/71. Simplify Path/README.txt similarity index 100% rename from Daily Challenge/71. Simplify Path/71. Simplify Path.txt rename to Daily Challenge/71. Simplify Path/README.txt From 2861c7791af6e636f13260fa2bcb94dba750e01d Mon Sep 17 00:00:00 2001 From: Pranav Mathur <72330781+DARKcoder37@users.noreply.github.com> Date: Fri, 14 Apr 2023 21:14:43 +0530 Subject: [PATCH 31/34] Rename 946. Validate Stack Sequences.txt to README.txt --- .../{946. Validate Stack Sequences.txt => README.txt} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Daily Challenge/946. Validate Stack Sequences/{946. Validate Stack Sequences.txt => README.txt} (100%) diff --git a/Daily Challenge/946. Validate Stack Sequences/946. Validate Stack Sequences.txt b/Daily Challenge/946. Validate Stack Sequences/README.txt similarity index 100% rename from Daily Challenge/946. Validate Stack Sequences/946. Validate Stack Sequences.txt rename to Daily Challenge/946. Validate Stack Sequences/README.txt From 2e29218443c2050756410662c8ab98c84a4ee0c5 Mon Sep 17 00:00:00 2001 From: Pranav Mathur <72330781+DARKcoder37@users.noreply.github.com> Date: Fri, 14 Apr 2023 21:15:23 +0530 Subject: [PATCH 32/34] Rename 2 sum problem.txt to README.txt --- .../1) 2 sum (easy)/{2 sum problem.txt => README.txt} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename Problem Solution/1) 2 sum (easy)/{2 sum problem.txt => README.txt} (91%) diff --git a/Problem Solution/1) 2 sum (easy)/2 sum problem.txt b/Problem Solution/1) 2 sum (easy)/README.txt similarity index 91% rename from Problem Solution/1) 2 sum (easy)/2 sum problem.txt rename to Problem Solution/1) 2 sum (easy)/README.txt index fc7be0b..3b876fc 100644 --- a/Problem Solution/1) 2 sum (easy)/2 sum problem.txt +++ b/Problem Solution/1) 2 sum (easy)/README.txt @@ -28,4 +28,4 @@ Constraints: 2 <= nums.length <= 104 -109 <= nums[i] <= 109 -109 <= target <= 109 -Only one valid answer exists. \ No newline at end of file +Only one valid answer exists. From 1b137f8d1a03ba5734003bcd4fafaba0c43b77af Mon Sep 17 00:00:00 2001 From: Pranav Mathur <72330781+DARKcoder37@users.noreply.github.com> Date: Fri, 14 Apr 2023 21:15:58 +0530 Subject: [PATCH 33/34] Rename Add two numbers.txt to README.txt --- .../{Add two numbers.txt => README.txt} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename Problem Solution/2) Add two number (medium)/{Add two numbers.txt => README.txt} (93%) diff --git a/Problem Solution/2) Add two number (medium)/Add two numbers.txt b/Problem Solution/2) Add two number (medium)/README.txt similarity index 93% rename from Problem Solution/2) Add two number (medium)/Add two numbers.txt rename to Problem Solution/2) Add two number (medium)/README.txt index bc1e447..377bcb2 100644 --- a/Problem Solution/2) Add two number (medium)/Add two numbers.txt +++ b/Problem Solution/2) Add two number (medium)/README.txt @@ -26,4 +26,4 @@ Constraints: The number of nodes in each linked list is in the range [1, 100]. 0 <= Node.val <= 9 -It is guaranteed that the list represents a number that does not have leading zeros. \ No newline at end of file +It is guaranteed that the list represents a number that does not have leading zeros. From 041e6921a7039e1cd3e9b8a79d3d8ba2bf8e3db6 Mon Sep 17 00:00:00 2001 From: Pranav Mathur <72330781+DARKcoder37@users.noreply.github.com> Date: Fri, 14 Apr 2023 21:16:25 +0530 Subject: [PATCH 34/34] Rename Longest Substring Without Repeating Characters.txt to README.txt --- ...st Substring Without Repeating Characters.txt => README.txt} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename Problem Solution/3) Longest Substring Without Repeating Characters/{Longest Substring Without Repeating Characters.txt => README.txt} (86%) diff --git a/Problem Solution/3) Longest Substring Without Repeating Characters/Longest Substring Without Repeating Characters.txt b/Problem Solution/3) Longest Substring Without Repeating Characters/README.txt similarity index 86% rename from Problem Solution/3) Longest Substring Without Repeating Characters/Longest Substring Without Repeating Characters.txt rename to Problem Solution/3) Longest Substring Without Repeating Characters/README.txt index ad85ada..31663aa 100644 --- a/Problem Solution/3) Longest Substring Without Repeating Characters/Longest Substring Without Repeating Characters.txt +++ b/Problem Solution/3) Longest Substring Without Repeating Characters/README.txt @@ -27,4 +27,4 @@ Notice that the answer must be a substring, "pwke" is a subsequence and not a su Constraints: 0 <= s.length <= 5 * 104 -s consists of English letters, digits, symbols and spaces. \ No newline at end of file +s consists of English letters, digits, symbols and spaces.