title: Dynamic programming: Find largest diamond (rhombus)
body: <p>I have a small program to do in Java. I have a 2D array filled with 0 and 1, and I must find the largest rhombus (as in square rotated by 45 degrees) and their numbers.</p>
  
  <p>Example:</p>
  
  <pre>
  0 1 0 0 0 1
  
  1 0 1 1 1 0
  
  1 0 1 1 1 1
  
  0 1 1 1 1 1
  
  0 0 1 1 1 1
  
  1 1 1 1 1 1
  </pre>
  
  <p>Result:</p>
  
  <pre>
        1    
  
      1 1 1  
  
    1 1 1 1 1
  
      1 1 1  
  
        1    
  </pre>
  
  <p>The problem is similar to <a href="https://stackoverflow.com/questions/1726632/dynamic-programming-largest-square-block">this SO question</a>.</p>
  
  <p>If you have any idea, post it here.</p>