title: Find if the array contain a 2 next to a 2
body: <p>I am stuck on this problem</p>
  
  <blockquote>
    <p>Given an array of ints, return True if the array contains a 2 next to a 2 somewhere.</p>
  </blockquote>
  
  <pre><code>has22([1, 2, 2]) → True
  has22([1, 2, 1, 2]) → False
  has22([2, 1, 2]) → False
  </code></pre>
  
  <p>I know the basic idea (there are syntax errors) but I can't implement it. I would also like to know what type of problem this is, eg. graph, search?</p>
  
  <pre><code>def has22(nums):
  for x in nums:
      if ( (nums[x] = 2) and (nums[x+1] = 2) )
          return True
  
  return False 
  </code></pre>