Skip to main content
Commonmark migration
Source Link

Java (OpenJDK 8), 134 bytes

a->{int b=a.length,i=0,j=0;for(;i++<b;){for(;j<b;j++){if(a[j].length()!=b||a[i].charAt(j)!=a[j].charAt(i))return false;}}return true;}

Try it online!

###Explanation:

Explanation:

int b=a.length,i=0,j=0;                               //Create Variables
for(;i++<b;){for(;j<b;j++){                           //Nested Loop
if(a[j].length()!=b||a[i].charAt(j)!=a[j].charAt(i))  //Is the grid valid?
    return false;                                     //if not, return false
}}
return true;                                     //if it gets this far, return true

Java (OpenJDK 8), 134 bytes

a->{int b=a.length,i=0,j=0;for(;i++<b;){for(;j<b;j++){if(a[j].length()!=b||a[i].charAt(j)!=a[j].charAt(i))return false;}}return true;}

Try it online!

###Explanation:

int b=a.length,i=0,j=0;                               //Create Variables
for(;i++<b;){for(;j<b;j++){                           //Nested Loop
if(a[j].length()!=b||a[i].charAt(j)!=a[j].charAt(i))  //Is the grid valid?
    return false;                                     //if not, return false
}}
return true;                                     //if it gets this far, return true

Java (OpenJDK 8), 134 bytes

a->{int b=a.length,i=0,j=0;for(;i++<b;){for(;j<b;j++){if(a[j].length()!=b||a[i].charAt(j)!=a[j].charAt(i))return false;}}return true;}

Try it online!

Explanation:

int b=a.length,i=0,j=0;                               //Create Variables
for(;i++<b;){for(;j<b;j++){                           //Nested Loop
if(a[j].length()!=b||a[i].charAt(j)!=a[j].charAt(i))  //Is the grid valid?
    return false;                                     //if not, return false
}}
return true;                                     //if it gets this far, return true
added 121 characters in body
Source Link
X1M4L
  • 1.9k
  • 11
  • 17

Java (OpenJDK 8), 116134 bytes

a->{int b=a.length,i=0,j=0;for(;i++<b;){for(;j<b;j++){if(a[i]a[j].length()!=b||a[i].charAt(j)!=a[j].charAt(i))return false;}}return true;}

Try it online!Try it online!

###Explanation:

int b=a.length,i=0,j=0;                               //Create Variables
for(;i++<b;){for(;j<b;j++){                           //Nested Loop
if(a[i]a[j].length()!=b||a[i].charAt(j)!=a[j].charAt(i))  //Is the grid valid?
    return false;                                     //if not, return false
}}
return true;                                     //if it gets this far, return true

Java (OpenJDK 8), 116 bytes

a->{int b=a.length,i=0,j=0;for(;i++<b;){for(;j<b;j++){if(a[i].charAt(j)!=a[j].charAt(i))return false;}}return true;}

Try it online!

###Explanation:

int b=a.length,i=0,j=0;             //Create Variables
for(;i++<b;){for(;j<b;j++){         //Nested Loop
if(a[i].charAt(j)!=a[j].charAt(i))  //Is the grid valid?
    return false;                   //if not, return false
}}
return true;                        //if it gets this far, return true

Java (OpenJDK 8), 134 bytes

a->{int b=a.length,i=0,j=0;for(;i++<b;){for(;j<b;j++){if(a[j].length()!=b||a[i].charAt(j)!=a[j].charAt(i))return false;}}return true;}

Try it online!

###Explanation:

int b=a.length,i=0,j=0;                               //Create Variables
for(;i++<b;){for(;j<b;j++){                           //Nested Loop
if(a[j].length()!=b||a[i].charAt(j)!=a[j].charAt(i))  //Is the grid valid?
    return false;                                     //if not, return false
}}
return true;                                     //if it gets this far, return true
Source Link
X1M4L
  • 1.9k
  • 11
  • 17

Java (OpenJDK 8), 116 bytes

a->{int b=a.length,i=0,j=0;for(;i++<b;){for(;j<b;j++){if(a[i].charAt(j)!=a[j].charAt(i))return false;}}return true;}

Try it online!

###Explanation:

int b=a.length,i=0,j=0;             //Create Variables
for(;i++<b;){for(;j<b;j++){         //Nested Loop
if(a[i].charAt(j)!=a[j].charAt(i))  //Is the grid valid?
    return false;                   //if not, return false
}}
return true;                        //if it gets this far, return true