Many operating systems let you use * (an asterisk) as a wildcard when you name a file. A * matches any string, and the empty string counts.
Wildcards are often used to name several files at once, and they also make naming a single file easier. Suppose you want to name the file pascalisamazing. If it is the only file matching the pattern pascal*, then that pattern names pascalisamazing, and pascal* is much shorter to type.
Given two file names, find the shortest pattern that matches the first name but not the second.
A pattern is a string of lowercase letters and *. The pattern matches a name if you can replace each * in it with some string, possibly the empty string, and get exactly that name.