# SICP Solutions

### Section - 2.2 - Hierarchical Data and the Closure Property

#### Exercise 2.41

I used procedure unique-pairs from previous exercise.

Example/Output:

Note that this method can be further optimized if we have a different form of map in which it discards nil elements or it also accepts a predicate by which we can select or reject.