For this Question: Given a boolean Matrix of size N*M, A cell of the matrix is called "Good" if it is completely surrounded by the cells containing '1' i.e. each adjacent cell (which shares a common edge) contains '1'. Your task is to find the number of such cells.

See the below example for a better understandingFirst line of input contains two space- separated integers N and M. Next N lines of input contain M space- separated integers depicting the values of the matrix.

Constraints:-
3 <= N, M <= 500
0 <= Matrix[][] <= 1Print the number of good cells.Sample Input:-
3 3
1 1 0
1 1 1
1 1 1

Sample Output:-
1

Explanation:- 
Only cell at position 1, 1 is good

Sample Input:-
5 4
1 0 1 0
0 1 0 1
1 0 1 0
0 1 0 1
1 0 1 0

Sample Output:-
3

Explanation:-
(1, 2), (2, 1) and (3, 2) are good cells, I have written this Solution Code:    // mat is the matrix/ 2d array
    // n,m are dimensions
    function goodCell(mat, n, m) {
        // write code here
        // do not console.log
        // return the answer as a number

        let cnt = 0;
        for (let i = 1; i < n - 1; i++) {
            for (let j = 1; j < m - 1; j++) {
                if (mat[i - 1][j] == 1 && mat[i + 1][j] == 1 && mat[i][j - 1] == 1 && mat[i][j + 1] == 1) {
                    cnt++;
                }
            }
        }
        return cnt
    }

, In this Programming Language: JavaScript, Now tell me if this Code is compilable or not?