Shopee interview question

Q: How do you solve this problem?