Smallest Number Following Pattern Leetcode Playground