I just had a go at this.. didn't take long. Not sure if there's a "better" way of doing this but (not gonna paste my code) i used 3 for loops and selected the initialisation and test statement of each looping variable (i, j, k) very carefully.
Tip: Try writing out all the combinations of array indexes that will need to be checked. You'll find there's a systematic way of doing it that avoids duplications.
__________________
There are only two industries that refer to their customers as "users". - Edward Tufte
|