Given 3 numbers, I need to find which number lies between the two others.
ie,given 3,5,2 I need 3 to be returned.
I tried to implement this by going thru all three and using if else conditions to check if each is between the other two.But this seems a naive way to do this.Is there a better way?
[1,1,2]?