Hello,
I am an expert at algorithmic programming in C++ and Java. I have a recursive algorithm in mind for the question you have posted, and I can start developing it immediately. I guarantee on time completion with good quality code that will have comments, functions and a GUI. Lets talk further in chat :)