Sauce Labs interview question

A Leetcode easy question, check string with pattern