Python interview with a LinkedIn engineer: Matching pairs