# Category Archives: Matrix

Given a 4 x 4 matrix, the task is to interchange the elements of first and last columns and show the resulting matrix.Examples:Â Â  Input: 8â€¦ Read More
Given a grid of dimension M * N where each cell varies from 1 to 6 and each of the values present in the cellâ€¦ Read More
Construct a matrix whose each row contains N 1’s and each column contains M 1’s. Examples: Input: N = 3, M = 4Output:1 1 11â€¦ Read More
Printing Boundary Elements of a Matrix. Given a matrix of size n x m. Print the boundary elements of the matrix. Boundary elements are thoseâ€¦ Read More
Given two integers N and M that denotes the number of rows and columns of a matrix that is initially empty, the task is toâ€¦ Read More
Given a matrix of dimension N*N whose all cells are initially 0. You are given Q queries, each of type {a, b, c, d} whereâ€¦ Read More
Given a matrix mat[][], the task is to find the sum of all the elements of the matrix. Examples: Input: mat[][] = {{1, 2, 3},â€¦ Read More
Given two integers N and M which denote the size of a matrix where initially all the cells are 0s. There are also K queriesâ€¦ Read More
There are N persons and N jobs. Given an array arr[] of size N*N where (arr[0], arr[1], . . ., arr[N-1]) denotes the time takenâ€¦ Read More
Given two integers X and Y, which represent the number of rows and columns respectively of a matrix, the task is to check whether thereâ€¦ Read More
Given a binary matrix B[][] of size N*M, the task is to find a matrix A[][] of the same size such that B[i][j] is theâ€¦ Read More
Given a matrix mat[][] of size N * M, and Q queries each of type {L, R} that denotes a range of row [L, R].â€¦ Read More
Given a matrix arr[][] of size M * N, where arr[i][j] represents the height of the cell (row, col). The task is to find aâ€¦ Read More
Given a matrix mat[][] of size N * N (1 â‰¤ N â‰¤ 1000), the task is to find the number of pairs of rowsâ€¦ Read More
What is a Matrix? A matrix is a two-dimensional array that consists of rows and columns. It is an arrangement of elements in horizontal orâ€¦ Read More