Avalara Interview Question

Medium leetcode problem based on string.