title: Find A Rotation With Maximum Hamming Distance
signature: def findARotationWithMaximumHammingDistance(arr: List[Int], n: Int) = {
source_py: def find_a_rotation_with_maximum_hamming_distance(arr, n):
      brr = ([0] * ((2 * n) + 1))
      for i in range(n):
          brr[i] = arr[i]
      for i in range(n):
          brr[(n + i)] = arr[i]
      maxHam = 0
      for i in range(1, n):
          currHam = 0
          k = 0
          for j in range(i, (i + n)):
              if (brr[j] != arr[k]):
                  currHam += 1
                  k = (k + 1)
          if (currHam == n):
              return n
          maxHam = max(maxHam, currHam)
      return maxHam
source_cpp: int find_a_rotation_with_maximum_hamming_distance(vector<int> arr, int n) {
    int brr [ 2 * n + 1 ];
    for ( int i = 0;
    i < n;
    i ++ ) brr [ i ] = arr [ i ];
    for ( int i = 0;
    i < n;
    i ++ ) brr [ n + i ] = arr [ i ];
    int maxHam = 0;
    for ( int i = 1;
    i < n;
    i ++ ) {
      int currHam = 0;
      for ( int j = i, k = 0;
      j < ( i + n );
      j ++, k ++ ) if ( brr [ j ] != arr [ k ] ) currHam ++;
      if ( currHam == n ) return n;
      maxHam = max ( maxHam, currHam );
    }
    return maxHam;
  }