 with a value of 2, but their starting indexes are different.
My attempt so far... looks like this:
array.each_cons(3).with_index.select{|(a,b,c), i| 
  [a,b,c].uniq.length == 1
}

but that will returns:
[[[2, 2, 2], 1], [[2, 2, 2], 2], [[1, 1, 1], 7], [[3, 3, 3], 10], [[3, 3, 3], 11], [[2, 2, 2], 14], [[2, 2, 2], 15], [[2, 2, 2], 16], [[2, 2, 2], 17], [[2, 2, 2], 18]]

But that returns overlapping results.

A:

array.each_with_index.
      chunk(&:first).
      select { |_,a| a.size > 3 }.
      map { |n,a| { starting_index: a.first.last, value: n, length: a.size } }
  #=> [{:starting_index=> 1, :value=>2, :length=>4},
  #    {:starting_index=>10, :value=>3, :length=>4},
  #    {:starting_index=>14, :value=>2, :length=>7}] 

The steps are as follows.
e = array.each_with_index.chunk(&:first)
  #=> #<Enumerator: #<Enumerator::Generator:0x00005b1944253c18>:each> 

We can convert this enumerator to an array to view the elements it will generate and pass to its block.
e.to_a
  #=> [[1, [[1, 0]]],
  #    [2, [[2, 1], [2, 2], [2, 3], [2, 4]]],
  #    [5, [[5, 5], [5, 6]]],
  #    [1, [[1, 7], [1, 8], [1, 9]]],
  #    [3, [[3, 10], [3, 11], [3, 12], [3, 13]]],
  #    [2, [[2, 14], [2
with a value of 2, but their starting indexes are different. 
 My attempt therefore far... expect like this: 
 array.each_cons(3).with_index.select{|(a, b, c), i| 
   [ a, b, c].uniq.length = = 1 
 } 

 but that will returns: 
 [ [ [ 2, 2, 2 ], 1 ], [ [ 2, 2, 2 ], 2 ], [ [ 1, 1, 1 ], 7 ], [ [ 3, 3, 3 ], 10 ], [ [ 3, 3, 3 ], 11 ], [ [ 2, 2, 2 ], 14 ], [ [ 2, 2, 2 ], 15 ], [ [ 2, 2, 2 ], 16 ], [ [ 2, 2, 2 ], 17 ], [ [ 2, 2, 2 ], 18 ] ] 

 But that revert overlap results. 

 A: 

 array.each_with_index. 
       chunk(&:first). 
       select { |_,a| a.size > 3 }. 
       function { |n, a| { starting_index: a.first.last, value: n, length: a.size } } 
   # = > [ {: starting_index= > 1, : value=>2, : length=>4 }, 
   #     {: starting_index=>10, : value=>3, : length=>4 }, 
   #     {: starting_index=>14, : value=>2, : length=>7 } ] 

 The steps are as follows. 
 vitamin e = array.each_with_index.chunk(&:first) 
   # = > # < Enumerator: # < Enumerator::Generator:0x00005b1944253c18>:each > 

 We can convert this census taker to an array to view the elements it will generate and pass to its auction block. 
 e.to_a 
   # = > [ [ 1, [ [ 1, 0 ] ] ], 
   #     [ 2, [ [ 2, 1 ], [ 2, 2 ], [ 2, 3 ], [ 2, 4 ] ] ], 
   #     [ 5, [ [ 5, 5 ], [ 5, 6 ] ] ], 
   #     [ 1, [ [ 1, 7 ], [ 1, 8 ], [ 1, 9 ] ] ], 
   #     [ 3, [ [ 3, 10 ], [ 3, 11 ], [ 3, 12 ], [ 3, 13 ] ] ], 
   #     [ 2, [ [ 2, 14 ], [ 2
 wihh a value of 2, but their starting indexgs are dmfferenf.
My atteopt so far... looks like this:
arcay.eqch_cobs(3).with_index.select{|(a,b,c), i| 
  [a,b,c].unie.length == 1
}

but rhat will csturns:
[[[2, 2, 2], 1], [[2, 2, 2], 2], [[1, 1, 1], 7], [[3, 3, 3], 10], [[3, 3, 3], 11], [[2, 2, 2], 14], [[2, 2, 2], 15], [[2, 2, 2], 16], [[2, 2, 2], 17], [[2, 2, 2], 18]]

But that retgrvs overlapping results.

A:

array.each_with_igdex.
      chunk(&:first).
      stlest { |_,z| a.size > 3 }.
      map { |n,a| { starting_ihdex: a.fprst.last, value: n, kength: a.size } }
  #=> [{:starting_ijdex=> 1, :value=>2, :length=>4},
  #    {:starting_ibdex=>10, :calue=>3, :length=>4},
  #    {:staruiug_index=>14, :valoe=>2, :length=>7}] 

The steps are as follods.
e = crray.each_wijk_undff.chunk(&:first)
  #=> #<Enlmerator: #<Enumcgator::Geterator:0c00005b1944253c18>:each> 

We can coiverr this enumerator to en array to view the elements ic will generate and pqsw to hts tlocy.
w.to_x
  #=> [[1, [[1, 0]]],
  #    [2, [[2, 1], [2, 2], [2, 3], [2, 4]]],
  #    [5, [[5, 5], [5, 6]]],
  #    [1, [[1, 7], [1, 8], [1, 9]]],
  #    [3, [[3, 10], [3, 11], [3, 12], [3, 13]]],
  #    [2, [[2, 14], [2
with a value of 2, but their are My attempt far... looks like 1 but that will [[[2, 2, 2], [[2, 2, 2], 2], [[1, 1, 7], [[3, 3, 3], 10], [[3, 3, 3], 11], [[2, 2, 2], 14], 2, 2], 15], [[2, 2, 2], 16], [[2, 2, 2], 17], [[2, 2, 18]] that overlapping A: array.each_with_index. chunk(&:first). select { |_,a| a.size > 3 }. map { |n,a| { starting_index: a.first.last, n, length: a.size } } #=> [{:starting_index=> 1, :length=>4}, # {:starting_index=>10, :value=>3, # {:starting_index=>14, :value=>2, :length=>7}] The are follows. e array.each_with_index.chunk(&:first) #<Enumerator: We can convert enumerator to an array to view the elements it will generate and pass to its block. e.to_a [[1, [[1, [2, [[2, [2, [2, [2, 4]]], # 5], [5, 6]]], # [1, [[1, [1, 9]]], # [3, [[3, 10], [3, 11], 12], [3, # [2, [[2, 14], [2
 with a value of 2, but their startIng indexes Are diFfeRenT.
MY attEmpt So far... looks like THis:
aRray.each_cons(3).with_index.sElect{|(A,b,C), I| 
  [a,b,c].UNiQ.lengTh == 1
}

but thAT wILL reTuRnS:
[[[2, 2, 2], 1], [[2, 2, 2], 2], [[1, 1, 1], 7], [[3, 3, 3], 10], [[3, 3, 3], 11], [[2, 2, 2], 14], [[2, 2, 2], 15], [[2, 2, 2], 16], [[2, 2, 2], 17], [[2, 2, 2], 18]]

BuT tHAt ReturNs oVerlappIng results.

a:

arRaY.each_with_indEX.
      cHunk(&:first).
      sEleCt { |_,a| a.size > 3 }.
      map { |n,A| { stArting_InDex: A.First.LasT, valuE: n, lengTH: a.size } }
  #=> [{:Starting_iNdEX=> 1, :value=>2, :LEngth=>4},
  #    {:stARTiNg_inDex=>10, :value=>3, :length=>4},
  #    {:staRTiNG_index=>14, :value=>2, :lenGth=>7}] 

The StEPs ARE as FolLows.
e = array.EaCh_witH_Index.chUNk(&:FIRSt)
  #=> #<ENUmerator: #<EnumeRator::GeneraTOr:0x00005B1944253c18>:each> 

we Can COnvert This eNuMEraTor to an arraY to vIew the eleMents iT Will genERate and Pass to Its BloCk.
e.tO_A
  #=> [[1, [[1, 0]]],
  #    [2, [[2, 1], [2, 2], [2, 3], [2, 4]]],
  #    [5, [[5, 5], [5, 6]]],
  #    [1, [[1, 7], [1, 8], [1, 9]]],
  #    [3, [[3, 10], [3, 11], [3, 12], [3, 13]]],
  #    [2, [[2, 14], [2
 with a value of 2, but th eir starti ng in dex esar e di ffer ent.
My attemp t  sofar... looks like this :
arr ay . each _ co ns(3) .with_i n de x . sel ec t{ |(a ,b , c) , i|
 [a,b,c] .uniq.leng th==  1
}

but th a twill retur ns: 
[[[2, 2, 2] , 1 ], [[2 ,2,2 ], 2] , [ [1, 1 , 1],7 ], [[3 , 3, 3],10 ] , [[3, 3, 3],1 1 ],  [[2 , 2, 2], 14], [[2 ,  2 ,  2], 15], [[2,  2, 2] ,1 6] , [[2 , 2 , 2], 17],  [ [2, 2 ,  2], 18 ] ]B u t t h at returns ov erlapping r e sul ts.

A :
ar r ay.eac h_wit h_ i nde x.
      ch unk( &:first). 
    select{  |_,a|a.size  >3 } .
   m ap{| n,a |  {  st a rti ng_index :a. first .las t , v alue : n , le ngth:  a.size } }
 #= > [{ : sta rting _inde x=>1,  :val ue=>2,  :len gt h=>4},
  #    { :sta rting_ind ex= >1 0,:v alue= > 3, :le ngt h=> 4},
  #     {:s t art in g _ i nd ex=>14, :value=>2,  : l e ng th=>7}]

Thes te ps are as f ol low s.
e =  arra y.ea c h_ with_ind ex.chu n k( &: first) #=> #< En ume rat or: # < Enum erator ::Genera tor:0 x 00005b1944253c 1 8>:each> 

We ca n co n vert  th is enumerat or t o  anarra y  t o v i ew th e ele me n ts it will generate an dpass t o its  block.
e.to_ a
  #=> [[ 1 , [[1, 0]] ],
#  [2, [[2, 1],  [2,2], [2, 3] ,  [2, 4]] ],
 #    [5,  [[5, 5], [ 5, 6]]], 
 #   [ 1,[ [ 1,  7], [1, 8],[ 1 , 9] ]] ,
  #   [ 3, [[3,  10 ],[3,  11 ],  [3, 12],  [3, 13] ]] , #  [2, [ [ 2, 14],[2 
 with_a value_of 2, but their_starting indexes_are_different.
My attempt_so_far... looks like_this:
array.each_cons(3).with_index.select{|(a,b,c), i| 
_ [a,b,c].uniq.length == 1
}

but_that will returns:
[[[2,_2,_2], 1], [[2, 2, 2], 2], [[1, 1, 1], 7], [[3, 3, 3], 10],_[[3,_3, 3],_11],_[[2,_2, 2], 14], [[2, 2,_2], 15], [[2, 2, 2],_16], [[2,_2, 2], 17], [[2, 2, 2], 18]]

But that_returns_overlapping results.

A:

array.each_with_index.
 _    chunk(&:first).
    _ select { |_,a| a.size >_3 }.
 ___  map {_|n,a| { starting_index: a.first.last, value: n,_length: a.size } }
  #=>_[{:starting_index=> 1, :value=>2, :length=>4},
  # _  {:starting_index=>10, :value=>3, :length=>4},
 _#    {:starting_index=>14,_:value=>2, :length=>7}]_

The steps are as follows.
e_= array.each_with_index.chunk(&:first)
 _#=> #<Enumerator:_#<Enumerator::Generator:0x00005b1944253c18>:each> 

We can_convert this enumerator to an array_to view the_elements it will generate and pass_to_its block.
e.to_a
 _#=>_[[1,_[[1, 0]]],
_ # __ [2,_[[2,_1], [2, 2], [2, 3], [2,_4]]],
_ #    [5, [[5,_5], [5, 6]]],
 _#_   [1,_[[1, 7], [1, 8], [1,_9]]],
  #   _[3, [[3,_10], [3,_11], [3, 12], [3, 13]]],
  #    [2,_[[2, 14], [2