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)

        # longest path algorithm
        _, _, last = self.bfs(0, V)
        level, pi, last = self.bfs(last, V)

        ret = []
        cur = last
        for _ in xrange((level-1)/2):
            cur = pi[cur]
        ret.append(cur)

        if level % 2 == 0:
            ret.append(pi[cur])

        return ret
The HTTP status code as an integer (e.g. 404).
dataset/ETHPy150Open algorhythms/LeetCode/310 Minimum Height Trees.py/Solution.findMinHeightTrees--crossover with--dataset/ETHPy150Open Arelle/Arelle/arelle/webserver/bottle.py/BaseResponse.status_code