Count number of islands where every island is row-wise and column-wise separated

Given a rectangular matrix which has only two possible values ‘X’ and ‘O’. The values ‘X’ always appear in form of rectangular islands and these… Read More »

Find a common element in all rows of a given row-wise sorted matrix

Given a matrix where every row is sorted in increasing order. Write a function that finds and returns a common element in all rows. If… Read More »

Given a matrix of ‘O’ and ‘X’, replace ‘O’ with ‘X’ if surrounded by ‘X’

Given a matrix where every element is either ‘O’ or ‘X’, replace ‘O’ with ‘X’ if surrounded by ‘X’. A ‘O’ (or a set of… Read More »

Given a matrix of ‘O’ and ‘X’, find the largest subsquare surrounded by ‘X’

Given a matrix where every element is either ‘O’ or ‘X’, find the largest subsquare surrounded by ‘X’. In the below article, it is assumed… Read More »

Flood fill Algorithm – how to implement fill() in paint?

In MS-Paint, when we take the brush to a pixel and click, the color of the region of that pixel is replaced with a new… Read More »

Accolite Interview | Set 2 (On-Campus)

Accolite came to our campus for recruitment. First Round Written Test: 30 MCQs in which question related to DS Networking OS Unix commands DBMS. Questions… Read More »

Print all elements in sorted order from row and column wise sorted matrix

Given an n x n matrix, where every row and column is sorted in non-decreasing order. Print all elements of matrix in sorted order. Example:… Read More »

MakeMyTrip Interview Experience

MakeMyTrip recently visited our campus to hire full time employees. Here’s my interview experience: Round 1: (Online MCQs) Questions on aptitude, English, logical reasoning, C/C++… Read More »

Mobile Numeric Keypad Problem

Given the mobile numeric keypad. You can only press buttons that are up, left, right or down to the current button. You are not allowed… Read More »

Given an n x n square matrix, find sum of all sub-squares of size k x k

Given an n x n square matrix, find sum of all sub-squares of size k x k where k is smaller than or equal to… Read More »

Program to check if two given matrices are identical

The below program checks if two square matrices of size 4*4 are identical or not.For any two matrix to be equal, number of rows and… Read More »

Python Program to find transpose of a matrix

Transpose of a matrix is obtained by changing rows to columns and columns to rows. In other words, transpose of A[][] is obtained by changing… Read More »

Program to find transpose of a matrix

Transpose of a matrix is obtained by changing rows to columns and columns to rows. In other words, transpose of A[][] is obtained by changing… Read More »

Program for subtraction of matrices

The below program subtracts of two square matrices of size 4*4, we can change N for different dimension. C++ filter_none edit close play_arrow link brightness_4… Read More »

Program for addition of two matrices

The below program adds two square matrices of size 4*4, we can change N for different dimension. Recommended: Please solve it on “PRACTICE” first, before… Read More »