def findMinHeightTrees(self, n, edges):
        if not edges:
            return 0

        V = {i: [] for i in xrange(n)}
        for a, b in edges:
            V[a].append(b)
            V[b].append(a)

        leaf = None
        for k, v in V.items():
            if len(v) == 1:
                leaf = k
                break

        # bfs
        visisted = [False for _ in xrange(n)]
        h2v = defaultdict(list)
        q = []
        level = 0
        q.append(leaf)
        while q:
            l = len(q)
            for i in xrange(l):
                cur = q[i]
                h2v[level].append(cur)
                visisted[cur] = True
                for nbr in V[cur]:
                    if not visisted[nbr]:
                        q.append(nbr)

            q = q[l:]
            level += 1

        if level % 2 == 0:
            return h2v[level/2-1]+h2v[level/2]
        else:
            return h2v[level/2]
Loads client configuration from settings file.
dataset/ETHPy150Open algorhythms/LeetCode/310 Minimum Height Trees.py/SolutionError.findMinHeightTrees--crossover with--dataset/ETHPy150Open googledrive/PyDrive/pydrive/auth.py/GoogleAuth.LoadClientConfigSettings