Meta interview question

I was asked two leetcode mediums