We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Higher-Order Functions Practice

Doc2Doc needs a way to restore documents from saved backups. However, not all original documents necessarily have backups, and some backups might be corrupted.

Assignment

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.

Tip

I used map, filter, and lambda functions to complete the function on one "line," but it's formatted in multiple lines for readability.