

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Still calibrating
click for more info
Not enough gems
Cost: 6 gems
1: Functions As Values
incomplete
2: Anonymous Functions
incomplete
3: First-Class and Higher-Order Functions
incomplete
4: Map
incomplete
5: Filter
incomplete
6: Reduce
incomplete
7: Map, Filter, and Reduce Review
incomplete
8: Zip
incomplete
9: Higher-Order Functions Practice
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
Doc2Doc needs a way to restore documents from saved backups. However, not all original documents necessarily have backups, and some backups might be corrupted.
Complete the restore_documents function in one line – if you can. It takes two tuples of document strings, originals and backups, as input. It should return a single clean set of all valid documents from both tuples.
I used map, filter, and lambda functions to complete the function on one "line," but it's formatted in multiple lines for readability.