Skip to content

Instantly share code, notes, and snippets.

@ktilcu
Created August 15, 2017 23:30
Show Gist options
  • Select an option

  • Save ktilcu/0bc52dadf74c8574ccc8b087635d648b to your computer and use it in GitHub Desktop.

Select an option

Save ktilcu/0bc52dadf74c8574ccc8b087635d648b to your computer and use it in GitHub Desktop.
kyle-Programming Problem: Identity Matrix

Build an identity Matrix for n columns and rows

Array(n).fill().map(_=>Array(n).fill(0)).map((v,i)=> {v[i%n]=1;return v.join``}).join`\n`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment