MATL, 7 bytes
X>tG=s*
Input is a two-row matrix, where each row is one of the arrays.
Explanation
X> % Implicit input. Maximum of each column
t % Duplicate
G % Push input
= % Is equal? Element-wise with broascastbroadcast. Gives a two-row matrix
s % Sum of each column. Gives a row vector containing 1 and 2
* % Multiply, element-wise. Implicit display
MATL, 7 bytes
X>tG=s*
Input is a two-row matrix, where each row is one of the arrays.
Explanation
X> % Implicit input. Maximum of each column
t % Duplicate
G % Push input
= % Is equal? Element-wise with broascast
s % Sum. Gives a row vector containing 1 and 2
* % Multiply, element-wise. Implicit display
MATL, 7 bytes
X>tG=s*
Input is a two-row matrix, where each row is one of the arrays.
Explanation
X> % Implicit input. Maximum of each column
t % Duplicate
G % Push input
= % Is equal? Element-wise with broadcast. Gives a two-row matrix
s % Sum of each column. Gives a row vector containing 1 and 2
* % Multiply, element-wise. Implicit display
MATL, 7 bytes
X>tG=s*
Input is a two-row matrix, where each row is one of the arrays.
Explanation
X> % Implicit input. Maximum of each column
t % Duplicate
G % Push input
= % Is equal? Element-wise with broascast
s % Sum. Gives a row vector containing 1 and 2
* $% Multiply, element-wise. Implicit display
MATL, 7 bytes
X>tG=s*
Input is a two-row matrix, where each row is one of the arrays.
Explanation
X> % Implicit input. Maximum of each column
t % Duplicate
G % Push input
= % Is equal? Element-wise with broascast
s % Sum. Gives a row vector containing 1 and 2
* $ Multiply, element-wise. Implicit display
MATL, 7 bytes
X>tG=s*
Input is a two-row matrix, where each row is one of the arrays.
Explanation
X> % Implicit input. Maximum of each column
t % Duplicate
G % Push input
= % Is equal? Element-wise with broascast
s % Sum. Gives a row vector containing 1 and 2
* % Multiply, element-wise. Implicit display
MATL, 7 bytes
X>tG=s*
Input is a two-row matrix, where each row is one of the arrays.
Explanation
X> % Implicit input. Maximum of each column
t % Duplicate
G % Push input
= % Is equal? Element-wise with broascast
s % Sum. Gives a row vector containing 1 and 2
* $ Multiply, element-wise. Implicit display
MATL, 7 bytes
X>tG=s*
Input is a two-row matrix, where each row is one of the arrays.
Explanation
X> % Implicit input. Maximum of each column
t % Duplicate
G % Push input
= % Is equal? Element-wise with broascast
s % Sum. Gives a row vector containing 1 and 2
* $ Multiply, element-wise. Implicit display