Also reported as LeetCode 1249
Bloomberg coding question, reconstructed from 1 candidate report (February 2026). The write-up includes a Python solution that passes 8 test cases.