Count of Unique Direct Path Between N Points On a Plane | Function to count the total number of direct paths ; Driver Code
function countDirectPath ( N ) { return N + Math . floor ( ( N * ( N - 3 ) ) / 2 ) ; } let N = 5 ; document . write ( countDirectPath ( N ) ) ;