Line 10 you increment j instead of k. You'll also probably have an issue with line 7 since you allow j to go to n, which is outside the array bounds.
Momerath
Nearly a Senior Poster
3,386 posts since Aug 2010
Reputation Points: 1,232
Solved Threads: 558
Did you change line 7 to j < n rather than j < n + 1 ?
Momerath
Nearly a Senior Poster
3,386 posts since Aug 2010
Reputation Points: 1,232
Solved Threads: 558
Exception still in the same line? Could you post the current version of your code?
Momerath
Nearly a Senior Poster
3,386 posts since Aug 2010
Reputation Points: 1,232
Solved Threads: 558
I've tried to get it to generate an exception in that line and can't do it. What input are you using?
Momerath
Nearly a Senior Poster
3,386 posts since Aug 2010
Reputation Points: 1,232
Solved Threads: 558