Determine Whether Matrix Can Be Obtained By Rotation Problem
Determine Whether Matrix Can Be Obtained By Rotation Problem — ExecCode Easy DSA Practice
Solve the Determine Whether Matrix Can Be Obtained By Rotation problem on ExecCode. Free online easy DSA practice in Arrays - Logic Building. Write and run code in Java, C++, Python — no signup required to run.
Problem description
Description You are given two n x n binary matrices mat and target, return true if it is possible to make mat equal to target by rotating mat in 90-degree increments, or false otherwise.
Examples
Input {"mat": [[0, 1], [1, 0]], "target": [[1, 0], [0, 1]]}; Output True. Input {"mat": [[0, 1], [1, 1]], "target": [[1, 0], [0, 1]]}; Output False
Constraints
n == mat.length == target.length n == mat[i].length == target[i].length 1 <= n <= 10 mat[i][j] and target[i][j] are either 0 or 1.
Practice Determine Whether Matrix Can Be Obtained By Rotation free on ExecCode. Browse DSA problems, topic map, and placement guides.