Created
March 19, 2022 21:18
-
-
Save see-why/28cddac872922fc21662b79f4a796084 to your computer and use it in GitHub Desktop.
HackerRank Find the median challenge solution
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://www.hackerrank.com/challenges/find-the-median/problem?isFullScreen=true | |
public static int findMedian(List<int> arr) | |
{ | |
arr.Sort(); | |
int median_index = arr.Count/2; | |
return arr[median_index]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment