Pattern Printing Problems Leetcode