Check if the right move is valid
if ( isSafe ( row , col + 1 , m , n , visited ) ) { path += ' R ' ; printPathUtil ( row , col + 1 , m , n , visited ) ; path = path . Substring ( 0 , path . Length - 1 ) ; }