GroundTruth Interview Question

Typical algorithm question