Very simple recursive algorithm

Printable View