Medium
You are given points where points[i] = [x, y]. The cost to connect two points is their Manhattan distance. Return the minimum cost to connect all points so every pair is reachable. (Input rows are the points.)
Input: points = [[0,0],[2,2],[3,10],[5,2],[7,0]] Output: 20
Input: points = [[3,12],[-2,5],[-4,1]] Output: 18