input: Write a Python function to find the minimum spanning tree (MST) using Prim's Algorithm.
  assert primsMST([[0, 2, 0, 6, 0], [2, 0, 3, 8, 5], [0, 3, 0, 0, 7], [6, 8, 0, 0, 9], [0, 5, 7, 9, 0]], 5) == 16
  assert primsMST([[0, 1, 2, 0, 0], [1, 0, 4, 6, 0], [2, 4, 0, 5, 7], [0, 6, 5, 0, 3], [0, 0, 7, 3, 0]], 5) == 15
output: def primsMST(graph, V):
      key = [float('inf')] * V
      parent = [None] * V
      key[0] = 0
      mstSet = [False] * V
  
      for _ in range(V):
          min_key = float('inf')
          u = -1
          
          for v in range(V):
              if not mstSet[v] and key[v] < min_key:
                  min_key = key[v]
                  u = v
  
          mstSet[u] = True
  
          for v in range(V):
              if graph[u][v] > 0 and not mstSet[v] and key[v] > graph[u][v]:
                  key[v] = graph[u][v]
                  parent[v] = u
  
      return sum(key)