Pattern 4

Beginner Problems Patterns Easy
  • Many website and application development technologies use the concept underlying this problem, known as "looping"
  • For example, in Javascript, repeating elements are often rendered in a webpage using loops
  • If a React developer needs to display a repeating component, they could use a pattern similar to the given problem
  • This could be a list where each item should display a number of times corresponding to its value, like stars in a rating system or in creating user interface patterns
  • It's a fundamental concept in creating dynamic content based on variable data

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

22

333

4444

55555


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