Leetcode 2471. Minimum Number of Operations to Sort a Binary Tree by Level
Given a binary tree with unique values, compute the minimum number of value-swaps between nodes on the same level required to make every level strictly increasing — i.e., do a level-order traversal and for each level treat the values as a permutation and sum the minimum swaps to sort them (cycle-decomposition).
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
0
Hello Interview Premium
Your account is free and you can post anonymously if you choose.