Skip to content

Annas-Furquan-Pasha/Number-Pattern-6

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Number-Pattern-6

This is the number pattern which prints the pattern vertically based on the number in input_array

Example : For input pattern([1,2,3,4,5,4,3,2,1,2,3,4,5,4,3,2,1,2,3,4,5,4,3,2,1,2,3,4,5,4,3,2,1]) the pattern is :

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

For input pattern([5,3,6,2,4], '#') the pattern is :

    #     
#   #     
#   #   # 
# # #   # 
# # # # # 
# # # # # 

For input pattern([1,2,3,4,5,6,7,8,9], '$') the pattern is :

                $ 
              $ $ 
            $ $ $ 
          $ $ $ $ 
        $ $ $ $ $ 
      $ $ $ $ $ $ 
    $ $ $ $ $ $ $ 
  $ $ $ $ $ $ $ $ 
$ $ $ $ $ $ $ $ $

You can also view other Patterns Here