i , j are the indices of the current cell and prev is the character processed in the parent call . . also mat [ i ] [ j ] is our current character .
int getLenUtil ( char mat [ R ] [ C ] , int i , int j , char prev ) {