Pattern 9

Beginner Problems Patterns Easy
  • While developing console-based games, animations, or other graphical representations in terminal, such pattern creation problems come handy
  • They give an understanding of how to use control structures (like loops) for producing repetitive and patterned output
  • These concepts are fundamental in developing console output display features in many kinds of software
  • The ability to create and manipulate these patterns can be extended to more complex graphics rendering challenges

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:


    * 
   ***
  *****
 *******
*********
*********
 *******
  *****
   ***
    *


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