GGK Tech Interview Question

Print z pattern in one loop