dir = 0 for left , dir = 1 for facing right . This function returns number of maximum coins that can be collected starting from ( i , j ) .
int maxCoinsRec ( char arr [ R ] [ C ] , int i , int j , int dir ) {