FahimFBA / pattern-printing-java

Solve Any Pattern Question with This Trick! Learnt from Kunal Kushwaha.

Home Page:https://fahimfba.github.io/pattern-printing-java/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pattern-printing-java

GitHub Workflow Status Total Lines of Code License

Note

  1. Number of lines = number of rows = number times the outer loop will run
  2. Identify for every row numbers, how many columns are there or types of elements in the column
  3. What do you need to print
  4. Try to find the formula relating rows and columns

Patterns Covered Here (Using Java)

Pattern 1

* 
* * 
* * * 
* * * * 

Pattern 2

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

Pattern 3

* * * * 
* * * 
* * 
* 

Pattern 4

1 
1 2 
1 2 3 
1 2 3 4 

Pattern 5

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

Pattern 6

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

Pattern 7

        1 
      2 1 2 
    3 2 1 2 3 
  4 3 2 1 2 3 4 
5 4 3 2 1 2 3 4 5

Pattern 8

        1 
      2 1 2 
    3 2 1 2 3 
  4 3 2 1 2 3 4 
5 4 3 2 1 2 3 4 5
  4 3 2 1 2 3 4
    3 2 1 2 3
      2 1 2
        1

Pattern 9

4 4 4 4 4 4 4 4 4 
4 3 3 3 3 3 3 3 4 
4 3 2 2 2 2 2 3 4 
4 3 2 1 1 1 2 3 4 
4 3 2 1 0 1 2 3 4
4 3 2 1 1 1 2 3 4
4 3 2 2 2 2 2 3 4
4 3 3 3 3 3 3 3 4
4 4 4 4 4 4 4 4 4

About

Solve Any Pattern Question with This Trick! Learnt from Kunal Kushwaha.

https://fahimfba.github.io/pattern-printing-java/

License:The Unlicense


Languages

Language:Java 100.0%