Airbnb Interview Question

Leetcode problem from dp and string.