Bectran Interview Question

It’s an leetcode med level question