Menu
Coddy logo textTech

Recap - Treasure Hunt

Part of the Logic & Flow section of Coddy's Python journey — lesson 35 of 78.

challenge icon

Challenge

Easy

You're organizing a treasure hunt where participants search for treasures in different regions. Each region is represented by a set of treasures found there. You need to analyze the data to find:

  1. Shared Treasures: Treasures found in all regions.
  2. Unique Treasures in Region 1: Treasures only found in the first region.
  3. All Treasures: A list of all treasures discovered across all regions.
  4. Exclusive Treasures: Treasures that are unique to one region and not shared with any other region.

Check the test cases for the output format!

Try it yourself

region1 = eval(input())
region2 = eval(input())
region3 = eval(input())

# Write code here


# Print the results
print("Shared treasures:", sorted(list(shared_treasures)))
print("Unique treasures in region1:", sorted(list(unique_treasures_region1)))
print("All treasures:", sorted(list(all_treasures)))
print("Exclusive treasures:", sorted(list(exclusive_treasures)))

All lessons in Logic & Flow