Arcesium Interview Question

I was asked the following question in Round I: https://leetcode.com/problems/number-of-ways-to-form-a-target-string-given-a-dictionary