Roblox interview question

What is the most optimal solution