Hey I donot understand Why you actually need the second loop.
I prefer to do this
1)initialise all elements of your subarrays to '0'
2)Remove the second for loop
3)After finding the limit in which the value can be assigned in ,
Search for a zero in the sub array and then give it the value
Hope this makes sense.
Sky Diploma
Practically a Posting Shark
865 posts since Mar 2008
Reputation Points: 673
Solved Threads: 131