Pattern 13

Beginner Problems Patterns Easy
  • Fun Fact: The underlying concept of this problem is often used in the display logic of many applications
  • For instance, in social media apps like Instagram, the images are displayed in a similar pattern, where each new row may have more images than previous
  • Similar logic can be seen in calendar based applications and games, where the positions of different data points or objects are calculated dynamically based on a specific pattern
  • Understanding this ensures that developers can create interfaces that are adaptable and user friendly

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:


2 3 

4 5 6 

7 8 9 10 

11 12 13 14 15


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