KAAR interview question

Triangle pattern, code in preferred in language