Domanda di colloquio di Meta

solve a coding problem involving arrays, where I had to implement an efficient algorithm and then walk through edge cases. I also needed to explain the time and space complexity and justify my approach.