Count Connected Components Leetcode Python Solutions