Min Cost to Connect All Points (LeetCode 1584)The problem You get points on a 2-D plane. Connecting two points costs their…