Quote (carteblanche @ Apr 25 2014 07:33pm)
i dont understand what you're trying to do. can you go over that example again, step by step?
1) what is the sumtoget in your example? to sumtoget in my example was 20.
2) why are only the last two columns 0? i thought you said the entire row will be 0?
and Im sorry i didnt elaborate well. If there are elements adjacent in the row that equal exactly the sumtoget, then that new row in the new 2d array will equal those elements, all other elements in that row will be 0.
So again for example, if my row was 5 6 5 4 3 4 in my old 2d array,
the method would go through this row and see that 5 6 5 4 equal 20.
It would assign these elements to the same index as the old 2d array into the new 2d array.
the 3 and 4 would turn to 0 in the new array.
If none of the adjacent elements equal the sum to get, THEN the row will equal all 0.
And again, this would go row by row. Hopefully that helped, Thank you for looking and trying to help me.
This post was edited by chanceRaps on Apr 25 2014 05:39pm