Smallest Number Following Pattern Leetcode Problems On Strings