i think this question is wrong becouse it use or in the question like
horizontal or vertical way
but in test case it include horizontal and
vertical
i think this question is wrong becouse it use or in the question like
horizontal or vertical way
but in test case it include horizontal and
vertical
can u provide tutorial on this question
Scanner sc = new Scanner(System.in); int t = sc.nextInt(); int[] n = new int[t]; int[] m = new int[t]; for (int i = 0; i < t; i++) { n[i] = sc.nextInt(); m[i] = sc.nextInt(); } for (int i = 0; i < t; i++) { System.out.println(tproblem(n[i] , m[i], 0) ); } } public static int tproblem(int r, int c, int d) { if(c==r) { return 2; } if (c>r) { return 1; }else { return 1; } }
the tile can be placed horizontally or vertically means that there is no restriction on how the tile can be placed, it can be placed in both ways
har tile ka apna choice hai ki wo kaise place ho
This is not an or over the whole test case but over each individual tile as to how it can be placed