Citadel Interview Question

Leetcode style question that more focus on math reasoning.