Write a function that takes coordinates of four points (A, B, C, D) on a two-dimensional plane and returns true if the segment AB intersects segment CD.
intersection(arr[0]={2, 4}, arr[1]={5, 1}, arr[2]={4, 1}, arr[3]={4, 4}) ➞ true
intersection(arr[0]={1, 2}, arr[1]={3, 4}, arr[2]={5, 6}, arr[3]={7, 8}) ➞ false
intersection(arr[0]={1, 1}, arr[1]={1, 7}, arr[2]={-3, 3}, arr[3]={6, 3}) ➞ trueCheck my profile for other challenges in the series.