← Questions

Find every set in a hand of Set cards

0
SnowflakeCodingLast asked Jul 2026

Each card in the game Set has four attributes (color, shape, number, shading), and each attribute takes one of three values, so a card is four numbers from 0 to 2. Three cards form a set when, for every attribute, the three values are either all the same or all different. Given a list of cards, return every set.

Start with the direct triple loop, then use the fact that any two cards determine the third card that completes them.

Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding