Meta interview question

It was a leetcode question