Sauce Labs Interview Question

A Leetcode easy question, check string with pattern