Shopee interview question

Leetcode medium on two sum