From 878343c8c7403e215b4029afb97d911ab02295bf Mon Sep 17 00:00:00 2001 From: Uday garg <65303126+UdayGarg@users.noreply.github.com> Date: Sat, 1 Oct 2022 19:40:00 +0530 Subject: [PATCH 1/7] Create : 1299-Replace-Elements-with-Greatest-Element-on-Right-Side.py --- ...eplace-Elements-with-Greatest-Element-on-Right-Side.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 python/1299-Replace-Elements-with-Greatest-Element-on-Right-Side.py diff --git a/python/1299-Replace-Elements-with-Greatest-Element-on-Right-Side.py b/python/1299-Replace-Elements-with-Greatest-Element-on-Right-Side.py new file mode 100644 index 000000000..ff92025fb --- /dev/null +++ b/python/1299-Replace-Elements-with-Greatest-Element-on-Right-Side.py @@ -0,0 +1,8 @@ +class Solution: + def replaceElements(self, arr: List[int]) -> List[int]: + rightMax = -1 + for i in range(len(arr) -1, -1, -1): + newMax = max(rightMax, arr[i]) + arr[i] = rightMax + rightMax = newMax + return arr From ff36ed71931f56e22f49589337d681a44ba453eb Mon Sep 17 00:00:00 2001 From: Uday garg <65303126+UdayGarg@users.noreply.github.com> Date: Sat, 1 Oct 2022 20:12:11 +0530 Subject: [PATCH 2/7] Create: 392-is-subsequence.py --- python/392-is-subsequence.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 python/392-is-subsequence.py diff --git a/python/392-is-subsequence.py b/python/392-is-subsequence.py new file mode 100644 index 000000000..adf416fcc --- /dev/null +++ b/python/392-is-subsequence.py @@ -0,0 +1,8 @@ +class Solution: + def isSubsequence(self, s: str, t: str) -> bool: + i, j = 0, 0 + while i < len(s) and j < len(t): + if s[i] == t[j]: + i += 1 + j += 1 + return i == len(s) From ff19b2af5a407453f19208a66d2bd2881d23645d Mon Sep 17 00:00:00 2001 From: Uday garg <65303126+UdayGarg@users.noreply.github.com> Date: Sat, 1 Oct 2022 20:20:45 +0530 Subject: [PATCH 3/7] Revert "Create: 392-is-subsequence.py" This reverts commit ff36ed71931f56e22f49589337d681a44ba453eb. Undo commit to secure PR --- python/392-is-subsequence.py | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 python/392-is-subsequence.py diff --git a/python/392-is-subsequence.py b/python/392-is-subsequence.py deleted file mode 100644 index adf416fcc..000000000 --- a/python/392-is-subsequence.py +++ /dev/null @@ -1,8 +0,0 @@ -class Solution: - def isSubsequence(self, s: str, t: str) -> bool: - i, j = 0, 0 - while i < len(s) and j < len(t): - if s[i] == t[j]: - i += 1 - j += 1 - return i == len(s) From 75cf54431401f34f6c859e57b66373644abe9fa4 Mon Sep 17 00:00:00 2001 From: Uday garg <65303126+UdayGarg@users.noreply.github.com> Date: Sat, 1 Oct 2022 21:57:35 +0530 Subject: [PATCH 4/7] Create: 392-is-subsequence.py --- python/392-is-subsequence.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 python/392-is-subsequence.py diff --git a/python/392-is-subsequence.py b/python/392-is-subsequence.py new file mode 100644 index 000000000..adf416fcc --- /dev/null +++ b/python/392-is-subsequence.py @@ -0,0 +1,8 @@ +class Solution: + def isSubsequence(self, s: str, t: str) -> bool: + i, j = 0, 0 + while i < len(s) and j < len(t): + if s[i] == t[j]: + i += 1 + j += 1 + return i == len(s) From 2f98747517335920b8130a5c86c9263737ae85e2 Mon Sep 17 00:00:00 2001 From: Uday garg <65303126+UdayGarg@users.noreply.github.com> Date: Sat, 1 Oct 2022 22:09:15 +0530 Subject: [PATCH 5/7] Revert "Create : 1299-Replace-Elements-with-Greatest-Element-on-Right-Side.py" This reverts commit 878343c8c7403e215b4029afb97d911ab02295bf. Undo 1299-Replace-Elements-with-Greatest-Element-on-Right-Side due to one_change/PR --- ...eplace-Elements-with-Greatest-Element-on-Right-Side.py | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 python/1299-Replace-Elements-with-Greatest-Element-on-Right-Side.py diff --git a/python/1299-Replace-Elements-with-Greatest-Element-on-Right-Side.py b/python/1299-Replace-Elements-with-Greatest-Element-on-Right-Side.py deleted file mode 100644 index ff92025fb..000000000 --- a/python/1299-Replace-Elements-with-Greatest-Element-on-Right-Side.py +++ /dev/null @@ -1,8 +0,0 @@ -class Solution: - def replaceElements(self, arr: List[int]) -> List[int]: - rightMax = -1 - for i in range(len(arr) -1, -1, -1): - newMax = max(rightMax, arr[i]) - arr[i] = rightMax - rightMax = newMax - return arr From 55c0bfdefd132a64a9d7ff9961a5b0e0bc84e9c8 Mon Sep 17 00:00:00 2001 From: Uday garg <65303126+UdayGarg@users.noreply.github.com> Date: Sun, 2 Oct 2022 00:31:57 +0530 Subject: [PATCH 6/7] Rename 392-is-subsequence.py to 392-IS-SUBSEQUENCE.py --- python/{392-is-subsequence.py => 392-IS-SUBSEQUENCE.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename python/{392-is-subsequence.py => 392-IS-SUBSEQUENCE.py} (100%) diff --git a/python/392-is-subsequence.py b/python/392-IS-SUBSEQUENCE.py similarity index 100% rename from python/392-is-subsequence.py rename to python/392-IS-SUBSEQUENCE.py From 7e6ba04d96b5948d21910ad88cfe360a9eabf01b Mon Sep 17 00:00:00 2001 From: Uday garg <65303126+UdayGarg@users.noreply.github.com> Date: Sun, 2 Oct 2022 00:56:32 +0530 Subject: [PATCH 7/7] Rename 392-IS-SUBSEQUENCE.py to 392-Is-Subsequence.py --- python/{392-IS-SUBSEQUENCE.py => 392-Is-Subsequence.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename python/{392-IS-SUBSEQUENCE.py => 392-Is-Subsequence.py} (100%) diff --git a/python/392-IS-SUBSEQUENCE.py b/python/392-Is-Subsequence.py similarity index 100% rename from python/392-IS-SUBSEQUENCE.py rename to python/392-Is-Subsequence.py