# searching advanced

The First Repeated Card

You flip cards one by one β€” the game ends the first time you flip a card you've already seen. 🎴

You get a list of cards (a repeat is guaranteed). Print the first card that appears for the second time.

Example:

Input: cards = ["sun", "moon", "star", "moon", "sun"] Output: moon

"sun", "moon", and "star" are all new the first time. The second "moon" is the first card seen a second time.

πŸ’‘ need a hint?

srch-first-repeated-card.pyπŸ”’ given lines are locked β€” write your code in between
loading...