When test driving a vehicle, you are asked to make a checkmark on a tablet. Uponinspection, you have noticed many fingerprints on the screen. Aside from the rushof disgust, you notice that the fingerprints on the screen can be represented by aseries of 2D points on a standard Cartesian grid. You know that checkmarks can beuniquely defined by three points; these three points have distinct x coordinates andthe three points also have distinct y coordinates. The leftmost point must be lower than therightmost point and higher than the middle point. Now you want to know how many uniquecheckmarks you can make using the 2D points. Let’s consider some examples. The three points (1,2), (2,1), and (3,2) do not form a validcheckmark because the leftmost and rightmost points are at the same height. The three points (1,2), (2,1), and (2,3) do not form a valid checkmark because two points have the same x coordinates. The three points (1,2), (3,1), and (4,9) do form a valid checkmark. Given a list of 2D points, determine the number of unique checkmarks that can be formed fromthem.
When test driving a vehicle, you are asked to make a checkmark on a tablet. Upon inspection, you have noticed many fingerprints on the screen. Aside from the rush of disgust, you notice that the fingerprints on the screen can be represented by a series of 2D points on a standard Cartesian grid. You know that checkmarks can be uniquely defined by three points; these three points have distinct x coordinates and the three points also have distinct y coordinates. The leftmost point must be lower than the rightmost point and higher than the middle point. Now you want to know how many unique checkmarks you can make using the 2D points. Let’s consider some examples. The three points (1,2), (2,1), and (3,2) do not form a valid checkmark because the leftmost and rightmost points are at the same height. The three points (1,2), (2,1), and (2,3) do not form a valid checkmark because two points have the same x coordinates. The three points (1,2), (3,1), and (4,9) do form a valid checkmark. Given a list of 2D points, determine the number of unique checkmarks that can be formed from them.