This is not a different approach. This code does something else (and it does it wrong!). I suggested you to redesign your program not change its objectives. Did you read my previous post?
Start with...
Type: Posts; User: andreas90
This is not a different approach. This code does something else (and it does it wrong!). I suggested you to redesign your program not change its objectives. Did you read my previous post?
Start with...
If I were you I would make splt method return the index of the input number.
Then you can create two more lists by copying the elements of the initial list.
Spend some time to design your steps...
Hello jonathanfox!
if(i != n)
You need to compare the input number (n) with the value which is stored in position i not i itself. Look at the ArrayList's get(...) method. Then you can find the...