Pattern 3

Beginner Problems Patterns Easy
  • This problem is a fundamental example of string manipulation and loop control flow, both of which are essential in almost every area of software development
  • For example, this type of functionality is used in progress bar components, where each increment in the bar might require an additional character or content
  • Similarly, it's often used in visual representations of hierarchical data, like threaded discussion threads where each nested level might have an additional space or icon
  • In short, understanding and solving this problem can help a developer create visually intuitive and user-friendly interfaces

Given an integer n. You need to recreate the pattern given below for any value of N. Let's say for N = 5, the pattern should look like as below:


1

12

123

1234

12345


Print the pattern in the function given to you.

Constraints

  • 1 <= n <= 20

Company Tags

TCS Cognizant Accenture Infosys Capgemini Wipro IBM HCL Tech Mahindra MindTree