Back to questions

Matrix Rotation Salesforce Python Interview Question

Matrix Rotation

Salesforce Python Interview Question

Given two n x n binary matrices and , return true if it is possible to make equal to by rotating mat in 90-degree increments, or false otherwise.

Example #1

Input: mat = , target =

Output: true

Explanation: We can rotate mat 180 degrees to go from the input to the

Matrix Rotation Example 1

Example #2

Input: mat = , target =

Output: false

Explanation: It is impossible to make mat equal to target by rotating .

Matrix Rotation Example 2

Input

Python

Output