SP26385 HARISH_PUZZLE - Harish and his rooks puzzle
Description
Harish is playing Eight Rooks Puzzle. In this puzzle, he must put exactly eight rooks onto an 8x8 chessboard. No two rooks must be in the same row, and no two rooks must be in the same column.
You are given a 8 x 8 board. The j-th column of the i-th row of board is either 'R' or '.'. If this is 'R', the cell in row i, column j contains a rook. Otherwise the cell doesn't contain a rook. Determine whether Harish solved the puzzle correctly. If he solved the puzzle correctly, print "YES". Otherwise print "NO".
Input Format
T -Number of test cases
Each test case contains a 8 X 8 character array indicating the chess board.
Each character in board will be either 'R' or '.'
Output Format
YES or NO indicating whether he has solved the puzzle.