Javascript Program to Check if all rows of a matrix are circular rotations of each other
Given a matrix of n*n size, the task is to find whether all rows are circular rotations of each other or not. Examples: Input: mat[][] = 1, 2, 3 3, 1, 2 2, 3, 1Output: YesAll rows are rotated permutationof each other.Input: mat[3][3] = 1, 2, 3 3, 2, 1 1, 3, 2Output: NoExplanation : As 3, 2, 1 is not