bool containsPattern(int* arr, int arrSize, int m, int k){ for (int i=0; i+m*k <= arrSize; ++i) { bool flag = true; for (int j=i+m; j<i+m*k && flag; j+=m) { if (memcmp(&arr[i], &arr[j], m * sizeof(int))) { flag = false; } } if (flag) return true; } return false; }