title: Count clouds in a 2d array
body: <p>I am trying to figure out this problem from CodeFights but I don't have much experience with graph traversal so I'm struggling.  One of the hints I read for this particular problem was "graph traversal" so I did a BFS but I'm not sure how to get the number of clouds.</p>
  
  <p>For whatever reason with this problem and many other problems, my mind tends to go blank when it comes time to write code for it.  I approached the problem as trying to find the contiguous 1's but to no avail.  Can anyone help me please?</p>
  
  <p><a href="https://codefights.com/interview/pDTvSuHBgAB9dz5ik/companies/N3sScnJbzdPDQaHPj" rel="nofollow noreferrer">https://codefights.com/interview/pDTvSuHBgAB9dz5ik/companies/N3sScnJbzdPDQaHPj</a></p>
  
  <p>Given a 2D grid skyMap composed of '1's (clouds) and '0's (clear sky), count the number of clouds. A cloud is surrounded by clear sky, and is formed by connecting adjacent clouds horizontally or vertically. You can assume that all four edges of the skyMap are surrounded by clear sky.</p>
  
  <p>Example</p>
  
  <pre><code>skyMap = [['0', '1', '1', '0', '1'],
           ['0', '1', '1', '1', '1'],
           ['0', '0', '0', '0', '1'],
           ['1', '0', '0', '1', '1']]
  </code></pre>
  
  <p>the output should be
  countClouds(skyMap) = 2;</p>
  
  <pre><code>skyMap = [['0', '1', '0', '0', '1'],
           ['1', '1', '0', '0', '0'],
           ['0', '0', '1', '0', '1'],
           ['0', '0', '1', '1', '0'],
           ['1', '0', '1', '1', '0']]
  </code></pre>
  
  <p>the output should be
  countClouds(skyMap) = 5.</p>