session2/challenge/8_array.rb
# Given an array of elements, return true if any element shows up three times in a row
#
# Examples:
# got_three? [1, 2, 2, 2, 3]  # => true
# got_three? ['a', 'a', 'b']  # => false
# got_three? ['a', 'a', 'a']  # => true
# got_three? [1, 2, 1, 1]     # => false
Given an array of elements, return true if any element shows up three times in a row
Examples:
got_three.
Given an array of elements return true if any element shows up three times in a row Examples : got_three .
def got_three?(arr)
  for i in (0..(arr.length-2))
    return true if arr[i] == arr[i+1] &&  arr[i] == arr[i+2]
  end
  return false
end
def got_three? ( arr ) for i in ( 0 .. ( arr . length - 2 ) ) return true if arr [ i ] == arr [ i + 1 ] && arr [ i ] == arr [ i + 2 ] end return false end
Given an array of elements, return true if any element shows up three times in a row
Examples:
got_three?
Given an array of elements return true if any element shows up three times in a row Examples : got_three?
arr
<not_specific>