Citadel interview question

A difficult leetcode problem was asked.