Alphabet Triangle

Given a positive integer n, return a left-aligned alphabet triangle with n rows. Row i contains the first i uppercase English letters, starting from A on…

Given a positive integer n, return a left-aligned alphabet triangle with n rows. Row i contains the first i uppercase English letters, starting from A on every row. Add no spaces or trailing newline; join adjacent rows with one newline character.

- 1 ≤ n ≤ 9 - n is always a positive integer. - Every row uses consecutive uppercase English letters beginning at A.

Example 1: input n = 4; output A AB ABC ABCD. Each row restarts at A and extends the prefix by one letter.

Example 2: input n = 1; output A. The smallest prefix contains only A.

Category: Pattern Programs. Topic: pattern-programs. Difficulty: Easy. Patterns: math.