Check Mate CHECKMATE Solution Codechef

Check Mate CHECKMATE Solution

Check Mate CHECKMATE Solution You are given a standard 8×88×8 chessboard which has exactly 33 pieces placed on it – 22 black rooks and 11 white king. The rows are numbered 11 to 88 from bottom to top, and the columns are numbered 11 to 88 from left to right. The cell at the intersection of the ii-th column and jj-th row is denoted (i,j)(i,j) (like the coordinate system on the xyxy-plane). Is it possible for … Read more

Utkarsh and Placement tests UTKPLC Solution Codechef

Utkarsh and Placement tests UTKPLC Solution

Utkarsh and Placement tests UTKPLC Solution Utkarsh is currently sitting for placements. He has applied to three companies named A,BA,B, and CC. You know Utkarsh’s order of preference among these 33 companies, given to you as characters first, second, and third respectively (where first is the company he prefers most). You also know that Utkarsh has received offers from exactly two of these three companies, … Read more

Increasing String INCREAST Solution Codechef

Increasing String INCREAST Solution You are given a string SS, consisting of lowercase English letters. You can do the following operation at most once : Choose a subsequence of the string SS, then remove it from SS and concatenate the subsequence at the end of the remaining string. Find the lexicographically minimum string that can be obtained by performing this operation at most once on SS. … Read more

Pyramid Traversal PYRAMIDMOVES Solution Codechef

Pyramid Traversal PYRAMIDMOVES Solution

Pyramid Traversal PYRAMIDMOVES Solution You are given a pyramid of the following form with an infinite number of rows: 1 2 3  4 5 6  7 8 9 10 …………………. From a cell, you can move to either the bottom-left cell or the bottom-right cell directly in contact with the current one (For example, you can make the following moves: 1→2,1→3,6→9,6→101→2,1→3,6→9,6→10, while … Read more

Squares Counting GRIDSQRS Solution Codechef

Squares Counting GRIDSQRS Solution You are given a binary square matrix AA of size N×NN×N. Let the value at cell (i,j)(i,j) be denoted by A(i,j)A(i,j). Your task is to count the number of square frames present in the grid. A square frame is defined to be a square submatrix of AA whose border elements are all ‘1’. Formally, A square submatrix of AA of size kk with top-left corner (i,j)(i,j) is defined to … Read more