The solution that use list.sort() is beautiful and elegant. I tried the RANDOMIZED-SELECT algorithm which comes from Introduction To Algorithms Third Edition.