1566. Detect Pattern of Length M Repeated K or More Times
https://leetcode.com/problems/detect-pattern-of-length-m-repeated-k-or-more-times
Description
Given an array of positive integers arr
, find a pattern of length m
that is repeated k
or more times.
A pattern is a subarray (consecutive sub-sequence) that consists of one or more values, repeated multiple times consecutively without overlapping. A pattern is defined by its length and the number of repetitions.
Return true
if there exists a pattern of length m
that is repeated k
or more times, otherwise return false
.
Example 1:
Example 2:
Example 3:
Example 4:
Example 5:
Constraints:
2 <= arr.length <= 100
1 <= arr[i] <= 100
1 <= m <= 100
2 <= k <= 100
ac
Previous1565. Unique Orders and Customers Per MonthNext1567. Maximum Length of Subarray With Positive Product
Last updated