Skip to content
This repository was archived by the owner on May 13, 2026. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions Q3/solution.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
class Solution:
def findMedianSortedArrays(self, nums1: List[int], nums2: List[int]) -> float:

# first we need to sort two arrays using time complexity
a=[]
b=[]
# using for loop and time
for each x in b
insert x into a
or q from 1 to m
if q == 1 then insert b[q] into a
else
insert b[q] into a starting from the position of b[q-1]
return length
#Now we have merged array length we can easily find median for odd and even case
length =len (merged_array)
if length % 2 == 0 :
med = (merged_array[(length/2)-1] + merged_array [length/2]/2
else :
med =merged_array [int(length/2)]