I am encountering a particular issue that I have been attempting to resolve through various methods. Unfortunately, despite my efforts, the current output is not aligning with what I desire. I would greatly appreciate it if someone could review my process and point out where I may be going wrong in order to achieve the desired outcome. I am working with an input number(n), which should fall within the range of 2 to 10. The task at hand involves validating whether the input value is outside of the expected range.
The output I am currently receiving is as follows:
If I enter n = 2:
A
B C
If I enter n = 3:
A
B C
D E F
However, the outputs that I am aiming for are as follows:
Example 1. If I input n = 3, the corresponding output should look like this:
A
A B
C D E
Example 2: If I input n = 4, the resulting output should be displayed as follows:
A
A B
A B C
D E F G
Access the Stackblitz here.