Excism
天才的な実装をまとめる
code:matrix
class Matrix {
rows: number[][];
columns: number[][];
constructor(m: string) {
this.rows = m.split("\n").map(v => v.split(" ").map(v => +v))
this.columns = this.transpose(this.rows)
}
private transpose = (a: number[][]) => a.map((_, i) => a.map(x => xi)); };
export default Matrix