Pattern Program In Leetcode Contest Solution