The while on line 7 looks wrong to me. This is a recursive solution, it shouldn't need another loop. I would expect a simple if.
You'll probably want a better print on line 32, since array is an array.
JamesCherrill
... trying to help
8,516 posts since Apr 2008
Reputation Points: 2,583
Solved Threads: 1,455
Skill Endorsements: 30
At the entry to your recursive method print the values of all the parameters so we can see where its going wrong.
To print the contents of the array you can use
System.out.println( Arrays.toString(array));
JamesCherrill
... trying to help
8,516 posts since Apr 2008
Reputation Points: 2,583
Solved Threads: 1,455
Skill Endorsements: 30
Forget the computer. Get a sheet of paper and work out how you would do this by hand. In detail. Then, and only then, write a program that does the same thing.
JamesCherrill
... trying to help
8,516 posts since Apr 2008
Reputation Points: 2,583
Solved Threads: 1,455
Skill Endorsements: 30