ideas on how to solve recursively