← Back to Question List
Python Quiz #44
Finding Duplicates Two Ways
To decide whether a list of n numbers holds a duplicate, one program compares every pair with two nested loops; another adds each number to a set after first checking whether it is already in it. Compare their time and extra space.