From 37efc111d6fb07055ef905e8042bebea2be972a0 Mon Sep 17 00:00:00 2001 From: Shubham Jain Date: Sat, 10 Jan 2026 17:50:43 -0600 Subject: [PATCH] Completed --- Solution.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Solution.py diff --git a/Solution.py b/Solution.py new file mode 100644 index 00000000..a08bc72f --- /dev/null +++ b/Solution.py @@ -0,0 +1,19 @@ +Problem 1: https://www.geeksforgeeks.org/find-the-missing-number-in-a-sorted-array/ +Time Complexity : O(n) +Space Complexity: O(1) + +for i in range(len(arr)): + idx = abs(arr[i])-1 + if 0 <= idx < len(arr) and arr[idx] > 0: + arr[idx] *=-1 + + for i in range(len(arr)): + if arr[i]>0: + return i+1 + + return len(arr)+1 + + +Problem 2 : https://www.geeksforgeeks.org/min-heap-in-java/ + +## Need to figure out the question. To be continued