Capstone~20 min

Capstone: Contains Duplicate

Not practiced yet: set creation, set.add, set membership, for loop, early return +4. Try it anyway, or do those reps first.

Given a list of integers nums, return True if any value appears at least twice, and False if every value is distinct.

Aim for one pass over the list.

Examples

innums = [1, 2, 3, 1]outTrue1 appears twice
innums = [1, 2, 3, 4]outFalse
innums = []outFalsenothing can repeat
main.pypracticePython