Pattern Program In Leetcode 1509