title: How to get matrix positions surrounded by common data?
body: <p>I have a defined matrix in Java</p>
  
  <pre><code>int[][] a={
      {0,0,0,0,0,0},
      {0,0,0,1,0,0},
      {0,1,1,0,1,0},
      {1,0,0,0,0,1},
      {0,1,0,1,0,1},
      {0,0,1,0,1,0}
  };
  </code></pre>
  
  <p>So I want to know what positions on matrix are surrounded by the lines made of "1" values, i.e., the group of positions with value of "0", as if the "1" were the perimeter of a irregular figure, and "0" values within the perimeter its area (in this case: a[2][3], a[3][1], a[3][2], a[3][3], a[3][4], a[4][2] and a[4][4]).</p>
  
  <p>How can I get these positions automatically?</p>