Minimum number of operations required to make all elements of at least one row of given Matrix prime
Given a matrix, mat[][] of size N * M, the task is to find the minimum count of operations required to make all elements of at least one row of the given matrix prime. In each operation, merge any two rows of the matrix based on the following conditions: If kth elements of both rows of the matrix, i.e, mat[i][k] and mat[j][k] are prime numbers or composite numbers then kth element of the merged row contains min(mat[i][k], mat[j][k]). Otherwise, kth element of the merged row contains the element which is prime. If it is not possible to get all elements of a row as prime numbers, then print -1. Examples: Input: mat[][] = { { 4, 6, 5 }, { 2, 9, 12 }, { 32, 7, 18 }, { 12, 4, 35 } } Output: 2 Explanation: Merging mat[0] and mat[1] modifies mat[][] to { { 2, 6, 5 }, { 32, 7, 18 }, { 12, 4, 35 } } Merging mat[0] and mat[1] modifies mat[][] to { { 2, 7, 5 }, { 12, 4, 35 } } Since first row of the matrix consists only of prime numbers, the required output is 2. Input: mat[][] = { {4, 6}, {8, 3}...