TikTok Interview Question

They asked a basic leetcode medium question. It was a about trees and graphs, and the OA was about sorting.