For this Question: An element of the matrix is called strange if its corresponding row and column contains all 1's. Given a boolean matrix of size N*M, your task is to find the number of strange elements.The first 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.

<b>Constraints:-</b>
3 &le;  N, M &le; 50
0 &le;  Matrix[][] &le; 1Print the number of strange elementsSample Input:-
3 2
1 1
0 1
1 1

Sample Output:-
2

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

Sample Output:-
2

<b>Explanation 1:-</b>
(0, 1) and (2, 1), I have written this Solution Code: 
import java.util.*;
import java.lang.*;
import java.io.*;

class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);
		
	int n = sc.nextInt();
	int m = sc.nextInt();
	int a[][] = new int[n][m];
	for(int i=0;i<n;i++){
	    for(int j=0;j<m;j++){
	        a[i][j]= sc.nextInt();
	    }
	}
	int cnt=0;
	int p=0;
	for(int i=0;i<n;i++){
	    for(int j=0;j<m;j++){
	        p=0;
	        if(a[i][j]==1){
	            for(int k=0;k<n;k++){
	                if(a[k][j]==1){p++;}
	            }
	            for(int k=0;k<m;k++){
	                if(a[i][k]==1){p++;}
	            }
	            if(p==(n+m)){
	                cnt++;}
	        }
	        
	    }
	}
	
	System.out.print(cnt);

}
	    


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