Q20

 Return the total number of distinct solutions.
1. Recursive method