And that reminded me that some people were nervous about doing the nested loop solution so asked if they could "brute force" it and we would accept that. Interview stress is a thing after all.
I'm intrigued by the slice/map solution. It would have been perfectly acceptable if you could explain what the functions did. In fact, it would have led to very probing conversations: my usual interview partner and me had a deep interest in elegant solutions.
I'm intrigued by the slice/map solution. It would have been perfectly acceptable if you could explain what the functions did. In fact, it would have led to very probing conversations: my usual interview partner and me had a deep interest in elegant solutions.