Qualcomm interview question

Coding questions were asked