Pergunta de entrevista da empresa TikTok

write fn to flatten array, hook to debounce