From 5eb3724d3ab2a99d5fa272ab9bd01ebc2b101ac9 Mon Sep 17 00:00:00 2001 From: Hitesh1090 Date: Thu, 2 Apr 2026 15:12:17 -0500 Subject: [PATCH] Competitive-Coding-10 Completed! --- buyAndSellStock.py | 11 ++++++++ peekingIterator.py | 64 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 buyAndSellStock.py create mode 100644 peekingIterator.py diff --git a/buyAndSellStock.py b/buyAndSellStock.py new file mode 100644 index 0000000..3d9d784 --- /dev/null +++ b/buyAndSellStock.py @@ -0,0 +1,11 @@ +# TC: O(n) +# SC: O(1) +class Solution: + def maxProfit(self, prices: List[int]) -> int: + profit=0 + n=len(prices) + for i in range(n-1): + if prices[i]