Problem Challenge: Insertion Count

Solve a problem to test and practice your knowledge and understanding of pattern matching using tries.

Problem statement

A pattern will match a word if it can be made equal to the word by inserting zero or more lowercase English characters at any position in the pattern.

Given an array of input string words and a string pattern, return the number of insertions required to match the pattern with the word. Return -1 if the pattern cannot match the word.

Example 1

Sample input

Get hands-on with 1400+ tech skills courses.