(UVA) Ant's Shopping Mall - Solution
Link to the problem: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=3942 import java.io.*; import java.util.*; class Main { public void process() throws NumberFormatException, IOException { Scanner sc = new Scanner(System.in); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); int numTests = sc.nextInt(); for (int test = 0; test < numTests; test++) { int numRows = sc.nextInt(); int numCols = sc.nextInt(); int[][] matrix = new int[numRows][numCols]; for (int i = 0; i < numRows; i++) { String line = sc.next(); for (int j = 0; j < numCols; j++) { matrix[i][j] = line.charAt(j)-'0'; } } int count = 0; int bestCount = Integer.MAX_VALUE; for (int j = 0; j < numCol