Leetcode Minimum Spanning Tree Practice