Also reported as LeetCode 235 · LeetCode 236 · LeetCode 1650
LinkedIn coding question, reconstructed from 4 candidate reports (November 2025 to February 2026). Candidates reported 2 follow-ups. The write-up includes a Python solution that passes 7 test cases.