Matrix Layer Rotation HackerRank Solution in C, C++, Java, Python
You are given a 2D matrix of dimension m*n and a positive integer r. You have to rotate the matrix r times and print the resultant matrix. Rotation should be …
You are given a 2D matrix of dimension m*n and a positive integer r. You have to rotate the matrix r times and print the resultant matrix. Rotation should be …
Given an array of integers, determine whether the array can be sorted in ascending order using only one of the following operations one time. Swap two elements. Reverse one sub-segment. …
Larry has been given a permutation of a sequence of natural numbers incrementing from 1 as an array. He must determine whether the array can be sorted using the following …
Ema built a quantum computer! Help her test its capabilities by solving the problem below. Given a grid of size n*m, each cell in the grid is either good or …
Bomberman lives in a rectangular grid. Each cell in the grid either contains a bomb or nothing at all. Each bomb can be planted in any cell of the grid …
We define P to be a permutation of the first n natural numbers in the range [1,n]. Let pos[i] denote the value at position i in permutation P using 1-based …
Madison, is a little girl who is fond of toys. Her friend Mason works in a toy manufacturing factory . Mason has a 2D board A of size with H*W …
There is a strange counter. At the first second, it displays the number 3. Each second, the number displayed by decrements by 1 until it reaches 1. In next second, …
Happy Ladybugs is a board game having the following properties: The board is represented by a string, b, of length n. The ith character of the string,b[i] , denotes ith …
Given an array of strings of digits, try to find the occurrence of a given pattern of digits. In the grid and pattern arrays, each string represents a row in …