Topcoder SRM 595 DIV2 250

Problem Statement

In short, You are given a string containing only characters R,G,B. We can remove the string from either end at each move( from left or from right). Finally, the string must contain only R or G or B.

You can find a detailed problem description here.

Continue reading

Advertisements

CODECHEF COOK38 RRMATRIX

Problem Statement

Let ‘A’ be a R x C  Matrix. Elements in ‘A’ are filled from 1 to R*C in row-major order. ‘B’ is also a R x C Matrix where the elements are filled in column-major order.

Find number of cells which satisfy the property Ai,j ==  Bi,j.

For a brief problem statement click here.

Continue reading

Topcoder SRM 594 DIV2 250

Problem Statement

In a nutshell, Given a M x N Matrix we have to check whether it is possible to visit all the cells starting from any location.

Moving Direction – If you are in the cell (x,y), you can only move to ( (x+1)%M, (y+1)%N )

You can find a detailed problem description here.

Continue reading