Meta Interview Question

I was asked two leetcode mediums