Boats Group Interview Question

Recursion based question in Java.