Base Case when the point is on the x or y - axis
if ( x == 0 and y == 0 ) : NEW_LINE INDENT return 1 NEW_LINE DEDENT dp = [ 0 ] * ( max ( x , y ) + 1 ) NEW_LINE p = max ( x , y ) NEW_LINE q = min ( x , y ) NEW_LINE