Qualcomm Interview Question

I was asked two puzzles to solve during my 2nd technical interview