Added solution for median of three problem