KAAR Interview Question

Triangle pattern, code in preferred in language