Also reported as LeetCode 84
Pinterest coding question, reconstructed from 1 candidate report (March 2026). The write-up includes a Python solution that passes 5 test cases.