Given two n x n binary matrices mat and target, return true if it is possible to make mat equal to target by rotatingmat in 90-degree increments, or false otherwise.
Example :
Input: mat = [[0,1],[1,0]], target = [[1,0],[0,1]]
Output: true
Explanation: We can rotate mat 90 degrees clockwise to make mat equal target.
You are given a square matrix of size n (it will be an odd integer). Rows are indexed 0 to n-1 from top to bottom and columns are indexed 0 to n-1 from left to right. The matrix consists of only '*' and '.'. '*' appears only once in the matrix while all other positions are occupied by '.'
Your task is to convert this matrix to a special matrix by following any of two operations any number of times.
you can swap any two adjacent rows, i and i+1 (0<= i < n-1)
you can swap any two adjacent columns, j and j+1 (0<= j < n-1)
Special Matrix is one that contains '*' at the middle of the matrix. e.g following is a size 7 special matrix
Alfie was a prisoner in mythland. Though Alfie was a witty and intelligent guy.He was confident of escaping prison.After few days of observation,He figured out that the prison consists of () cells.i.e The shape of prison was () matrix. Few of the cells of the prison contained motion detectors.So Alfie planned that while escaping the prison he will avoid those cells containing motion detectors.Yet before executing his plan,Alfie wants to know the total number of unique possible paths which he can take to escape the prison.Initially Alfie is in cell () while the exit of the cell ().
note:->Alfie can move in all four direction{ if his current location is (), he can move to either (), (), (), () }. If the first cell () and the last cell() contain motion detectors,then Alfie can't break out of the prison.