Below is the method I've got, however instead of using a return I'm storing the result in a global variable searchdata. This works however would not be elegant coding as return type methods are there for a reason.
I would like to convert the above to a recursive int method however cannot get it right. I've tried this below, yet it is only returning the value of the outer recursion.