1stDibs.com interview question

Optimize a function with renounce