title: Comparing integers in a block Sudoku Java
body: <p>Hello Im working on a Sudoku Checker which verifies the completed board's solution is correct. I'm currently stumped on how to check within the blocks. right now I have a boolean as follows
  where Im checking the upper left block (Block1). What I'm unsure about is what parameters to set it to and how to run the two for loops successfully.   </p>
  
  <p>The problem is that I want to check a section of a 2d array condensed too a 3x3 square and see if the integers in that area are not repeated that only 1-9 appear once. I have similar code in which i made this code that checks to see if a row has repeating integers and a column. </p>
  
  <pre><code>static boolean isBlock1Valid(int[][] sudokuBoard, int referenceRow, int referenceColumn)
  {
  
      for(int i =0; i&lt;2;i++){
          for(int j=0; j&lt;2; j++){
              if(sudokuBoard[i][j]==sudokuBoard[i][j])
                  return false;
          }
      }
      return true;
  }//end of isBlock1Valid
  </code></pre>
  
  <p>here is the row checker I used as reference to make the block checker</p>
  
  <pre><code>       static boolean IsValidRow(int[][] sudokuBoard, int referenceRow, int width)
  {
      //Compare each value in the row to each other
      for(int i = 0; i &lt; width; i++)
      {
          for(int j = i+1; j &lt; width; j++)
          {
  
              if(sudokuBoard[referenceRow][i] == sudokuBoard[referenceRow][j])
                  return false;
  
          }
      }
  
      return true;
  }
  </code></pre>