Pergunta de entrevista da empresa TikTok

question on searching algorithm in a list