Grokking the Coding Interview: Patterns for Coding Questions
Ask Author
Back to course home

0% completed

Vote For New Content
Python3 solution fails on test case { nodes = 3, edges = [[0,1],[0,2]] } on Leet...

J

Dec 19, 2022

Python3 solution fails on test case { nodes = 3, edges = [[0,1],[0,2]] } on LeetCode for LC 310. Minimum Height Trees ( https://leetcode.com/problems/minimum-height-trees/ ).

0

0

Comments
Comments
Design Gurus
Design Gurus3 years ago

Probably you have some local changes. The solution is accepted at LC.

The input you suggested works too:

n = 3 edges = [[0,1],[0,2]] Output [0] Expected [0]

J
J 3 years ago

Yep, made a typo -- the solution does work.

On this page