Amazon interview question

Leetcode style coding problems and optimizations