Common elements in all rows of a given matrix
You are given a m*n row wise sorted matrix. The task is to find the common element in all rows of given matrix. Examples: Input : mat[3][4]={{1,3,5,6}, {3,4,7,8}, {1,2,3,4}} Output: 3 Input : mat[4][4]={{2,3,4,5}, {1,2,3,6}, {2,3,5,6}, {1,2,3,4}} Output: 2 3 Approaches: A simple solution for this problem is to use Hasing. Create hash array of size n .… Read More »
