I am getting WA in few test cases, not able to figure out what is wrong in my method. Can anyone say what is wrong in my method or implementation
import java.util.*;import java.lang.*;public class a{public static void main(String[] args) {Scanner sc = new Scanner(System.in);int r = sc.nextInt();int c = sc.nextInt();int d = sc.nextInt();int a[][] = new int[r][c];for(int i=0;i<r;++i)for(int j=0;j<c;++j)a[i][j] = 0;boolean b[][] = new boolean[r][c];int con = 0;for(int i=0;i<r;++i){for(int j=0;j<c;++j){con = sc.nextInt();if(con == 1)
Read more… (30 words)