Check Mate CHECKMATE Solution Codechef

Check Mate CHECKMATE Solution

Check Mate CHECKMATE Solution You are given a standard 8×8 chessboard which has exactly 3 pieces placed on it 2 black rooks and 1 white king. The rows are numbered 1 to 8 from bottom to top, and the columns are numbered 1 to 8 from left to right. The cell at the intersection of the i-th column and j-th row is denoted (i,j) (like the coordinate system on the xy-plane). Is it possible for the … 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,B and C. You know Utkarsh’s order of preference among these 3 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 S, consisting of lowercase English letters. You can do the following operation at most once : Find the lexicographically minimum string that can be obtained by performing this operation at most once on S. Note that: Input Format Output Format For each test case, print a single line containing the lexicographically minimum string which … 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→10, while you cannot make … Read more

Squares Counting GRIDSQRS Solution Codechef

Squares Counting GRIDSQRS Solution You are given a binary square matrix A of size N×N. Let the value at cell (i,j) be denoted by 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 A whose border elements are all ‘1’. Formally, Refer to the sample explanation for more details. … Read more