Print all the super diagonal elements of the given square matrix

Given a square matrix mat[][] of size n * n. The task is to print all the elements which lie on the super-diagonal of the… Read More »

Print all the sub diagonal elements of the given square matrix

Given a square matrix mat[][] of size n * n. The task is to print all the elements which lie on the sub-diagonal of the… Read More »

Find the element in the matrix generated by given rules

Given some rules to generate an N * N matrix mat[][] and two integers R and C, the task is to find the element at… Read More »

Find row with maximum and minimum number of zeroes in given Matrix

Given a 2D matrix containing only zeroes and ones, where each row is sorted. The task is to find the row with the maximum number… Read More »

Find a way to fill matrix with 1’s and 0’s in blank positions

Given an N * M matrix mat[][] which consists of two types of characters ‘.’ and ‘_’. The task is to fill the matrix in… Read More »

Find maximum path sum in a 2D matrix when exactly two left moves are allowed

Given a 2D matrix arr[][] of dimensions N * M where N is number of rows and M is number of columns.The task is to… Read More »

Paths from entry to exit in matrix and maximum path sum

Given a maze which is a N * N grid grid[][]. Every cell of the maze contains either the number 1, 2 or 3 which… Read More »

Maximise matrix sum by following the given Path

Given a 2d-matrix mat[][] consisting of positive integers, the task is to find the maximum score we can reach if we have to go to… Read More »

Count of cells in a matrix which give a Fibonacci number when the count of adjacent cells is added

Given an M x N matrix mat[][]. The task is to count the number of good cells in the matrix. A cell will be good… Read More »

Queries to find the last non-repeating character in the sub-string of a given string

Given a string str, the task is to answer Q queries where every query consists of two integers L and R and we have to… Read More »

Find a sub matrix with maximum XOR

Problem Given a square matrix of side N we have to find a submatrix such that bitwise XOR of its elements is maximum, and we… Read More »

Print an N x M matrix such that each row and column has all the vowels in it

Given two integers N and M, the task is to print an N x M matrix such that each row and column contain all the… Read More »

Check if the given matrix is increasing row and column wise

Given a matrix mat[][], the task is to check if the given matrix is strictly increasing or not. A matrix is said to be strictly… Read More »

Queries for bitwise OR in the given matrix

Given an N * N matrix mat[][] consisting of non-negative integers and some queries consisting of top-left and bottom-right corner of the sub-matrix, the task… Read More »

Queries for bitwise AND in the given matrix

Given an N * N matrix mat[][] consisting of non-negative integers and some queries consisting of top-left and bottom-right corner of the sub-matrix, the task… Read More »