ZoomInfo Interview Question

Leetcode hard question. Horse Greedy algorithm