code: private static boolean subArraysEqual(final char[] arr,
        final int offA, final int offB,
        final int len) {
      if (offA < 0 || offB < 0
          || offA >= arr.length || offB >= arr.length
          || offA + len > arr.length || offB + len > arr.length) {
        return false;
      }
  
      for (int i = 0; i < len; ++i) {
        if (arr[offA + i] != arr[offB + i]) {
          return false;
        }
      }
  
      return true;
    }
docs: Compares two sub-arrays of the given character array for equalness. If the length is zero, the
  result is true if and only if the offsets are within the bounds of the array.
  
  @param arr  a char array
  @param offA first sub-array start offset
  @param offB second sub-array start offset
  @param len  length of the sub arrays to compare
  @return true if the sub-arrays are equal; false if not