Skip to content

This repository consists of various pattern problems in C++ including their solution starting from easy level going to hard level.

Notifications You must be signed in to change notification settings

thedeepanshuj/Pattern-Problems

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 

Repository files navigation

Pattern-Problems

This repository consists of various pattern problems including their solution starting from easy level going to hard level.

	**** You can also contribute new problems by contacting at thedeepanshujain@gmail.com ****

Getting Started

  • Windows users must have codeblocks or any similar C++ IDE installed on their system to run and code in C++.

    Download Codeblocks here

  • MacOS users can either use XCode or the terminal for compilation of files (latter is recommended)

  • Linux users have to do this from terminal

Pattern 1:

N = 4
	1
	1 1
	1 1 1
	1 1 1 1

Pattern 2:

N = 4
	1
	2 3
	4 5 6
	7 8 9 10

Pattern 3:

N = 4
	1
	2 3
	3 4 5
	4 5 6 7

Pattern 4:

N = 4
	1 1 1 1
	1 1 1
	1 1
	1

Pattern 5:

N = 4
	1 2 3 4
	1 2 3
	1 2
	1

Pattern 6:

N = 4
	      1
	    1 1
	  1 1 1
	1 1 1 1

Pattern 7:

N = 4
	      1
	    2 3
	  4 5 6
	7 8 9 10

Pattern 8:

N = 4
	      1
	    2 3
	  3 4 5
	4 5 6 7

Pattern 9:

N = 4
	1 1 1 1
	  1 1 1
	    1 1
	      1

Pattern 10:

N = 4
	1 2 3 4
	  1 2 3
	    1 2
	      1

Pattern 11:

N = 4
	A
	B B
	C C C
	D D D D

Pattern 12:

N = 4
	1 1 1 1
	0 0 0
	1 1
	0

Pattern 13:

N = 4
	D
	C D
	B C D
	A B C D

Pattern 14:

N = 4
	1
	3 2
	4 5 6
	10 9 8 7

Pattern 15:

N = 4
	A B C D D C B A
	  A B C C B A
	    A B B A
	      A A

Pattern 16:

N = 4
	4 4 4 4
	3 4 4 4
	2 3 4 4
	1 2 3 4

Pattern 17:

N = 4
	        0
	      1 0 1
	    2 1 0 1 2
	  3 2 1 0 1 2 3
	4 3 2 1 0 1 2 3 4

Pattern 18:

N = 5 (N is always odd)
	*
	* *
	* * *
	* *
	*

Pattern 19:

N = 5 (N is always odd)
	    *
	  * * *
	* * * * *
	  * * *
	    *

Pattern 20:

N = 5 (N is always odd)
	    1
	  1 2 3
	1 2 3 4 5
	  1 2 3
	    1

Pattern 21:

N = 4
	      1
	    2 3 2
	  3 4 5 4 3
	4 5 6 7 6 5 4

Pattern 22:

N = 5 #####(N is always odd)
	*
	 * *
	  * * *
	 * *
	*

Pattern 23:

N = 5
	1
	1 1
	1 2 1
	1 2 2 1
	1 2 2 2 1

Pattern 24:

N = 4
	1
	1 1
	2 0 2
	3 0 0 3

Pattern 25:

N = 4
	      *
	    * * *
	  * * * * *
	* * * * * * *

Pattern 26:

N = 4
	      1
	    2 1 2
	  3 2 1 2 3
	4 3 2 1 2 3 4

Pattern 27:

N = 5
	5 4 3 2 *
	5 4 3 * 1
	5 4 * 2 1
	5 * 3 2 1
	* 4 3 2 1

Pattern 28:

N = 4
	* 0 0 0 * 0 0 0 *
	0 * 0 0 * 0 0 * 0
	0 0 * 0 * 0 * 0 0
	0 0 0 * * * 0 0 0

Pattern 29:

N = 5
	1                 1
	1 2             2 1
	1 2 3         3 2 1
	1 2 3 4     4 3 2 1
	1 2 3 4 5 5 4 3 2 1

Pattern 30:

N = 5 #####(N is always odd)
	* * * * *
	* *   * *
	*       *
	* *   * *
	* * * * *

Pattern 31:

N = 5
	1       1
	 2     2
	  3   3
	   4 4
	    5
	   4 4
	  3   3
	 2     2
	1       1

Pattern 32:

N = 5
	1
	2 3
	4 5 6 7
	8 9 1 2 3 4 5 6
	7 8 9 1 2 3 4 5 6 7 8 9 1 2 3 4

Pattern 33:

N = 5
	1 * * * * *
	  2 * * * *
	    3 * * *
	      4 * *
                5 *
	      4 * *
	    3 * * *
	  2 * * * *
	1 * * * * *

About

This repository consists of various pattern problems in C++ including their solution starting from easy level going to hard level.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published