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