title: Python - Count the duplicate seq element in array
body: <p>How to solve this</p>
  
  <pre><code>Input: 2
  Array = [2,1,3,2,2,2,1,2,2]
  Result : 3 (Max of count of seq of 2)
  </code></pre>
  
  <p>I just simply used the for loop, it works fine. But is there any other efficient way?</p>
  
  <pre><code>for i in array:
      if i == input:
          Cnt = Cnt + 1
          if Cnt &gt; Result:
              Result = Cnt;
      else:
        Cnt = 0
  </code></pre>