Determine if two arrays are a rotated version of each other
Bug

I ran your code with the following arrays and your function thought that the two arrays were rotated versions of each other but they were not:

public static void main(String [] args)
{
    int [] a = { 0, 1, 2, 3, 0 };
    int [] b = { 0, 1, 1, 2, 3 };
    System.out.println(isRotatedVersion(a, b));
}


Output:


  true


Achieving a correct \$O(n)\$ solution

Determining if an array is a rotated version of another array is equivalent to searching for the first array within the second array concatenated with itself.  For example, given:

a = { 0, 0, 1, 2, 0 }
b = { 0, 0, 0, 1, 2 }


You can search for pattern a within this array, which is b doubled:

{ 0, 0, 0, 1, 2, 0, 0, 0, 1, 2 }


To do this in \$O(n)\$ time, you just need to implement a linear time string searching algorithm.  I would suggest using the Knuth Morris Pratt algorithm, which is easy to understand and implement.