Amazon interview question

Analyze User Website Visit Pattern (Leetcode 1152)