Qualcomm interview question

GeeksofGeeks interview question must be sufficient.