Qualcomm Interview Question

C and Python programming Question.