Skip to main content
formatting
Source Link
Jakob
  • 2.8k
  • 1
  • 14
  • 25

Java 8, 74 bytes

Essentially just a port of Kamil'sKamil's second C# solution here.

n->{int g[][]=new int[n][n],i=0;for(;i<n*n;i+=n-1)g[i/n][i%n]=1;return g;} 

Try It Online

Java 8, 74 bytes

Essentially just a port of Kamil's second C# solution here.

n->{int g[][]=new int[n][n],i=0;for(;i<n*n;i+=n-1)g[i/n][i%n]=1;return g;} 

Try It Online

Java 8, 74 bytes

Essentially just a port of Kamil's second C# solution here.

n->{int g[][]=new int[n][n],i=0;for(;i<n*n;i+=n-1)g[i/n][i%n]=1;return g;} 

Try It Online

Source Link
Jakob
  • 2.8k
  • 1
  • 14
  • 25

Java 8, 74 bytes

Essentially just a port of Kamil's second C# solution here.

n->{int g[][]=new int[n][n],i=0;for(;i<n*n;i+=n-1)g[i/n][i%n]=1;return g;} 

Try It Online