Salescode.ai interview question

Longest Subarray Containing at Most Two Distinct Elements