You are given three distinct integers. Your task is to return the middle value — the number that is neither the largest nor the smallest.
The middle value is also known as the median of the three numbers. You must determine which number lies between the other two, regardless of their input order.
Input: a = 3, b = 9, c = 5
Output: 5
Explanation: 5 lies between 3 and 9, making it the middle value.
Input: a = 10, b = 2, c = 6
Output: 6
Explanation: 6 is neither the smallest value (2) nor the largest value (10).
Input: a = 1, b = 3, c = 2
Output: 2
Explanation: 2 is the median of the three values because it lies between 1 and 3.
Sign in to write, run, and submit your solution against the full test suite.