reading half part of a table
- by eastafri
When i have a table;
1 0 0 1 0
0 1 0 1 0
0 0 1 0 1
1 1 1 1 0
0 0 0 0 1
Say i want to only read and keep the values along the upper diagonal of this table, how can i easily accomplish this in pure ruby?
Such that the final structure looks like
1 0 0 1 0
1 0 1 1
1 0 1
1 0
1
Thanks