homework solutio of Baseball Elimination