public class Schedule
{
    // package access for testing
    Appointment[][] sched;
    
    private int countInCol(String target, int col)
    {
        int count = 0;
        
        for(int r = 0; r < sched.length; r++)
            if(sched[r][col].getStatus().equals(target))
                count++;
        
        return count;
    }
    
    public int columnWithFewest(String target)
    {
        int colWithFewest = 0;
        
        for(int c = 1; c < sched[0].length; c++)
            if(countInCol(target, c) < countInCol(target, colWithFewest))
                colWithFewest = c;
        
        return colWithFewest;
    }
}
