title: Counting the number of times an element occurs in a given column for a 2D array?
body: <p>This is a method for a Sudoku game. </p>
  
  <p>Could someone explain their thought processes for this? :( I'm having a lot of difficulty figuring this out. I know for the first method, we're supposed to use a for loop or something.
  I know my iteration for my method is wrong...Sorry :(</p>
  
  <pre><code> private int countOccurrencesInCol(int col, int d){
     for (int i = 0; i &lt; grid.length; i++;){
       for(int j = col; j = col; j++;){
          if (grid[i][j] == d){
            count++;
          }
        }
      }
     return count;
   }
  </code></pre>
  
  <p>This method returns the number of times a digit occurs in a given column in a 9 X 9 matrix.</p>
  
  <pre><code>    private int countPossiblePlacementsInCol (int col, int d){
  </code></pre>
  
  <p>This method is supposed to determine the number of spots in a given column where a given digit can be placed, and returns the number of spots where a digit can be placed in a spot for a given column. If the digit already occurs, then the method returns 0. </p>