题目描述
For a given value N, denoting the number of Characters starting from the A, print reverse character bridge pattern.
Example 1:
Input:
N = 5
Output:
ABCDEDCBA
ABCD DCBA
ABC CBA
AB BA
A A
Example 2:
Input:
N = 4
Output:
ABCDCBA
ABC CBA
AB BA
A A
Your Task:
You don't need to read input or print anything. Your task is to complete the function revCharBridge() which takes an Integer N as input and returns a vector of strings where each line represents lines of the pattern. For example, if N = 3, the vector v = {"ABCBA", "AB BA", "A A"}.
Expected Time Complexity: O(N)
Expected Auxiliary Space: O(N)
Constraints:
2 <= N <= 26
输入格式
见题面
输出格式
见题面
样例输入
N = 5
样例输出
ABCDEDCBA
ABCD DCBA
ABC CBA
AB BA
A A