We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Algorithms
- Sorting
- Find the Median
- Discussions
Find the Median
Find the Median
Sort by
recency
|
561 Discussions
|
Please Login in order to post a comment
def findMedian(arr): n=len(arr) arr.sort() return arr[n//2]
def findMedian(arr): arr = sorted(arr,key=int) median = statistics.median(arr) return median
python solution function
Here is my c++ solution, you can watch the explanation here https://youtu.be/CbEYUUopR-8
My Java solution: