Code public class VendingMachine{ int rows, cols; int ts; // a total of seconds int ci, cj; // current i, current j; int[][] p; void addSecs(int nj) { int a = Math.abs(nj - cj); int b = cols - Math.abs(nj - cj); ts += (a < b) ? a : b; } void setMaxCol() { int max = -1, mj = cj; for (int j = 0; j < cols