count to 0.i from 0 to len(arr) - m.arr[i] with the element m positions ahead arr[i+m].count.count to 0.count reaches (k-1)*m, return true as we have found the pattern repeated k times.true, return false as no such pattern exists.