It was a leet-code-like question.
Anonymous
I answered it quickly using a brute-force method but they wanted to chat on how to improve efficiency. I also answered this while taking hints from them.
Check out your Company Bowl for anonymous work chats.