Sha256: 40a12fa04433d3cbb8a7d56317877efe45cccabb7636105faf9bda5069c28923
Contents?: true
Size: 537 Bytes
Versions: 211
Compression:
Stored size: 537 Bytes
Contents
function columnsFromRows(rows) { let columns = []; rows.forEach((row) => { row.forEach((n, index) => { columns[index] = columns[index] || []; columns[index].push(n); }); }); return columns; } function parseRows(description) { return description.split('\n').map((row) => { return row.split(' ').map((char) => parseInt(char, 10)); }); } class Matrix { constructor(description) { this.rows = parseRows(description); this.columns = columnsFromRows(this.rows); } } export default Matrix;
Version data entries
211 entries across 211 versions & 1 rubygems