Question: Given two Arrays, A and B, write a C++ function to check if B is a rotation of A. B is a rotation of A

Given two Arrays, A and B, write a C++ function to check if B is a rotation of A. B is a rotation of A iff the elements of B are the same elements of A after being shifted left n times for any integer n. For example: If A={1, 2, 3, 4) and B={3,4, 1, 2} then the function will return true because the elements of B are the same as A after being shifted left twice. Note: You must use the following header: bool isRotation(int arri[], int arr2[])
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
