PRACTICE PROBLEM 8
PRACTICE PROBLEM 8 Verification of 'L' shaped arrangement of Coins on Game Board (Id-2435) Consider a nxn board game with four types of coins red, green, blue and yellow. Given the state of the board with coins in all cells, develop an algorithm and write a C program to check if the same coins are placed in ‘L’ shape on the board. The number of cells in the vertical and horizontal line of ‘L’ shape should be same and should be greater than 1. Red coins are represented by ‘r’, blue coins are represented by ‘b’, green coins are represented by ‘g’ and yellow coins are represented by ‘y’. For example, given the configuration of a 4 X 4 board with coins as shown below, b r y r r r y b y r b b b r r r the program must print 'Yes'. As there is a 'L' shape as shown in the figure below. Input Format Number of rows, r Number of columns, c Next ‘r x c’ lines contains the elements in the matrix Elements in the matrix given row by row ...