Pergunta de entrevista da empresa Meta

solve some weird question about heap stack