There is a treasure hunt game in which parts of a treasure are hidden across $n$ islands, numbered $1$ to $n$. You start in island $1 ,$ and aim to collect all parts of the treasure, by hopping from island to island. Each island has a list of other islands you can directly go to. (Note that if you can directly go from island $i$ to island $j$, it does not necessary mean that you can directly go from $j$ to $i.)$ You can revisit the same island multiple times during your search. Design an algorithm that takes as input the number $n$ of islands, the $n$ neighbourhood lists, and determines if you can succeed in collecting all parts of the treasure. The algorithm should run in time $O\left(n^{2} \cdot 2^{n}\right)$.