AlgoFrames

Fill the seen-set

Warm-up · Trace the algorithm · about 5 min

Follow a seen-set scan of [7, 3, 10, 4, 3]. The set has 7 buckets and sends a value to bucket value mod 7. Answer each question before the step plays.

Example 1

Input:

{"values":[7,3,10,4,3]}

Output:

true

Constraints

  • The trace uses the input shown.

Learn the idea first: Hash maps for lookup and counting, a visual lesson.

More Hash maps for lookup and counting problems