MATL, 17 bytes
4:"Gas2YLG@X!X=va
Try it online! Or verify all test cases.
Outputs 1 for Pascal matrices, 0 otherwise.
###Explanation
Explanation
4: % Push [1 2 3 4]
" % For each
G % Push input: ×ばつN
a % ×ばつN vector containing 1 for matrix columns that have at least a nonzero
% entry, and 0 otherwise. So it gives a vector containing 1 in all entries
s % Sum. Gives N
2YL % Pascal matrix of that size
G % Push input
@ % Push current iteration index
X! % Rotate the matrix that many times in steps of 90 degress
X= % Are they equal?
v % Concatenate with previous accumulated result
a % Gives 1 if at least one entry of the vector is nonzero
% End (implicit). Display (implicit)
MATL, 17 bytes
4:"Gas2YLG@X!X=va
Try it online! Or verify all test cases.
Outputs 1 for Pascal matrices, 0 otherwise.
###Explanation
4: % Push [1 2 3 4]
" % For each
G % Push input: ×ばつN
a % ×ばつN vector containing 1 for matrix columns that have at least a nonzero
% entry, and 0 otherwise. So it gives a vector containing 1 in all entries
s % Sum. Gives N
2YL % Pascal matrix of that size
G % Push input
@ % Push current iteration index
X! % Rotate the matrix that many times in steps of 90 degress
X= % Are they equal?
v % Concatenate with previous accumulated result
a % Gives 1 if at least one entry of the vector is nonzero
% End (implicit). Display (implicit)
MATL, 17 bytes
4:"Gas2YLG@X!X=va
Try it online! Or verify all test cases.
Outputs 1 for Pascal matrices, 0 otherwise.
Explanation
4: % Push [1 2 3 4]
" % For each
G % Push input: ×ばつN
a % ×ばつN vector containing 1 for matrix columns that have at least a nonzero
% entry, and 0 otherwise. So it gives a vector containing 1 in all entries
s % Sum. Gives N
2YL % Pascal matrix of that size
G % Push input
@ % Push current iteration index
X! % Rotate the matrix that many times in steps of 90 degress
X= % Are they equal?
v % Concatenate with previous accumulated result
a % Gives 1 if at least one entry of the vector is nonzero
% End (implicit). Display (implicit)
MATL, 17 bytes
4:"Gas2YLG@X!X=va
Try it online! Or verify all test cases.
Outputs 1 for Pascal matrices, 0 otherwise.
###Explanation
4: % Push [1 2 3 4]
" % For each
G % Push input: ×ばつN
a % ×ばつN vector containing 1 for matrix columns that have at least a nonzero
% entry, and 0 otherwise. So it gives a vector containing 1 in all entries
s % Sum. Gives N
2YL % Pascal matrix of that size
G % Push input
@ % Push current iteration index
X! % Rotate the matrix that many times in steps of 90 degress
X= % Are they equal?
v % Concatenate with previous accumulated result
a % Gives 1 if at least one entry of the vector is nonzero
% End (implicit). Display (implicit)
MATL, 17 bytes
4:"Gas2YLG@X!X=va
Try it online! Or verify all test cases.
Outputs 1 for Pascal matrices, 0 otherwise.
MATL, 17 bytes
4:"Gas2YLG@X!X=va
Try it online! Or verify all test cases.
Outputs 1 for Pascal matrices, 0 otherwise.
###Explanation
4: % Push [1 2 3 4]
" % For each
G % Push input: ×ばつN
a % ×ばつN vector containing 1 for matrix columns that have at least a nonzero
% entry, and 0 otherwise. So it gives a vector containing 1 in all entries
s % Sum. Gives N
2YL % Pascal matrix of that size
G % Push input
@ % Push current iteration index
X! % Rotate the matrix that many times in steps of 90 degress
X= % Are they equal?
v % Concatenate with previous accumulated result
a % Gives 1 if at least one entry of the vector is nonzero
% End (implicit). Display (implicit)
MATL, 17 bytes
4:"Gas2YLG@X!X=va
Try it online! Or verify all test cases.
Outputs 1 for Pascal matrices, 0 otherwise.