Pregunta de entrevista de NVIDIA

Coding Question asking me basic algorithms