Leetcode 399 Python Optimize Root Definition Music