Practice/mediumAlphabet Pyramid
⏱ 00:00
Best: 0/100
Character Codes & PalindromesTarget Time: 15 mins

Alphabet Pyramid

Given an integer N, print a centered palindrome alphabet pyramid where row i contains letters from "A" up to the i-th letter, then back down to "A".

Input Format
A single integer N (1 <= N <= 26).
Output Format
Print N centered rows of alphabetic palindrome sequences.
Constraints:1 <= N <= 26
Concepts Required:
String.fromCharCode / char ASCII offsetAscending then descending character loop
Expected Pattern PreviewASCII Monospace
    A
   ABA
  ABCBA
 ABCDCBA
ABCDEDCBA

Notice how character spacing and row counts scale systematically based on the input N.

Concrete Examples

Example 1
Input:
5
Output:
    A
   ABA
  ABCBA
 ABCDCBA
ABCDEDCBA

Explanation: Row 1: A. Row 5: ABCDEDCBA.

← Back to All Challenges