title: Number of occurrences of an element in a 2d-array c++
body: <p>If I'm given a 2d array say <code>{{1,2},{2,3,4},{5,1,2,7}}</code>, how do I count how many times an element say <code>1</code> has occurred in the array?
  Is there any c++ STL function for this?</p>