Given a matrix mat][][] of size M x N which represents the topographic map of a region, and 0 denotes land and 1 denotes elevation,… Read More

# Category Archives: Matrix

Given a binary 2D array arr[] of dimension M * N representing a grid where ‘0‘ represents that there is a wall on the main… Read More

Given a binary matrix mat[][] of dimensions M x N and two-person P1, P2, the task is to find the person who finishes last in… Read More

Given a square matrix mat[][] of dimension N and an integer K, the task is to rotate the matrix by 90 degrees K times without… Read More

Given a sparse matrix mat[][] of dimensions N*M, the task is to construct and represent the original matrix using a Linked List and reconstruct the… Read More

Given an adjacency matrix adj[][] of an undirected graph consisting of N vertices, the task is to find whether the graph contains a Hamiltonian Path… Read More

Given a square symmetric matrix mat[][] of size N, the task is to find the minimum sum possible of an array arr[] of size N,… Read More

Given a binary matrix mat[][] of dimensions N * N, the task is to check if Bitwise AND of the decimal numbers obtained by concatenating… Read More

Given a matrix arr[][], consisting of only 0, 1, and 2, that represents an empty ward, an uninfected patient, and an infected patient respectively. In… Read More

Given a matrix grid[][] of dimensions M * N, three integers X, Y, and K, the task is to check if there exists any path… Read More

Given two matrices A[][] and B[][] of size M × N and an integer X, the task is to check if it is possible to… Read More

Given a matrix A[][] of size N * M and a 2D array queries[][] consisting of Q queries of the form {L, R}, the task… Read More

Given a binary matrix mat[][] of dimensions of N * M and pairs of integers src and dest representing source and destination cells respectively, the… Read More

Given a matrix M[][] of dimensions N * N, consisting only of integers from the range 1 to N, the task is to compute the sum… Read More