Answer the question
In order to leave comments, you need to log in
How to find the maximum number of repetitions in an array of consecutive ones?
There is an array of this kind. It is
necessary to calculate the maximum number of repeating elements in a row. For example, in this case, you need to calculate how many maximum 1 goes in a row (there are 4 repetitions).
const arr = [1, 5, 99, 1, 1, 1, 2, 8, 1, 1 ,1 ,1]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question