Rummy Algorithm