Shopee Interview Question

Q: How do you solve this problem?