Sponsored
Use these hints if you're stuck. Try solving on your own first.
Use a list of lists, adding both the element and the snap_id to each index.
Solve with full IDE support and test cases