Returns count of paths to reach ( i , j ) from ( 0 , 0 ) using at - most k turns . d is current direction , d = 0 indicates along row , d = 1 indicates along column .
def countPathsUtil ( i , j , k , d ) : NEW_LINE