Microsoft coding question, reconstructed from 2 candidate reports (January 2026). The write-up includes a Python solution that passes 5 test cases.