2-Dimensional Array
===

We are given an assignment regarding 2-D array which states:<br><br>
Given a rectangular 2-d <code> char grid [row] [col] </code> and a <code> char </code> to look for, find the smallest rectangle that contains all the occurrences of that char and returns its area. If there is only a single occurrence of the char, then the rectangle to enclose it is 1x1 and the area is 1. If the character does not appear, return an area of 0.<br> Here is the link to the problem and an example: http://www.stanford.edu/class/cs108/handouts081/03HW1CodeCamp.pdf (page 2) but we have to use <code> int charArea (char[][] grid, char ch) </code> instead of <code> int charArea (char ch) </code> <br><br>
Please help me come up with an algorithm. I am new in Java and I'm having a hard time thinking of a pseudocode/code. All I know is 

    import java.util.*;
    
    public class Area {
    
    	public static int charArea (char[][] grid, char ch) {
    		for (int i=0; i<3; i++) { //row
    			for (int j=0; j<4; j++) { //column
    			// What now, please?    					
    			}
    		}
    		return answer;
    	}
    	
    	public static void main(String[] args) {
    		char[][] grid = {
    				{'a', 'b', 'c', 'd'},
    				{'a', ' ', 'c', 'd'},
    				{'x', 'b', 'c', 'a'}
    		};
    		Scanner input = new Scanner (System.in);
    		System.out.print("Enter a character to look for: ");
    		String temp = input.nextLine();
    		char ch = temp.charAt(0);
    		System.out.print(charArea(grid, ch));
    	}
    
    }

Just please help me design an algorithm/pseudocode (or code, if you don't mind haha). Thank you so much!