# n balls and n cups algorithm design

You are given n balls and n cups. Each cup holds a particular weight, and once a ball is placed in it tells you whether the ball is too heavy or light or just right. You can’t compare the weight of the balls directly. A perfect pairing between balls and cups exist. Design an expected nlogn algorithm to find the pairing. Hint: modify quicksort.