value
and the required consecutive count k
.consec
is called with a new integer num
:
a. If num
equals value
, increment the count.
b. If num
does not equal value
, reset the count to zero.
c. Check if the count is greater than or equal to k
.
d. Return true
if the count is greater than or equal to k
, otherwise return false
.