Skip to content

Latest commit

 

History

History

02_Patterns

Pattern Questions and Solutions🔥

This repository contains solutions to various pattern questions along with detailed explanations and notes.

S.No Pattern Problem Link 🔗 Solution 💡 Notes 📝 Test Files 🧪
1
* * * * *
* * * * *
* * * * *
* * * * *
* * * * *
Problem Solution Notes Test
2
*
* *
* * *
* * * *
* * * * *
Problem Solution Notes Test
3
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
Problem Solution Notes Test
4
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5
Problem Solution Notes Test
5
* * * * *
* * * *
* * *
* *
*
Problem Solution Notes Test
6
1 2 3 4 5
1 2 3 4
1 2 3
1 2
1
Problem Solution Notes Test
7
        *
* * *
* * * * *
* * * * * * *
* * * * * * * * *
Problem Solution Notes Test
8
* * * * * * * * *
* * * * * * *
* * * * *
* * *
*
Problem Solution Notes Test
9
        *
* * *
* * * * *
* * * * * * *
* * * * * * * * *
* * * * * * * * *
* * * * * * *
* * * * *
* * *
*
Problem Solution Notes Test
10
*
* *
* * *
* * * *
* * * * *
* * * *
* * *
* *
*
Problem Solution Notes Test
11
1
0 1
1 0 1
0 1 0 1
1 0 1 0 1
Problem Solution Notes Test
12
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
Problem Solution Notes Test
13
1
2 3
4 5 6
7 8 9 10
11 12 13 14 15
Problem Solution Notes Test
14
A
A B
A B C
A B C D
A B C D E
Problem Solution Notes Test
15
A B C D E
A B C D
A B C
A B
A
Problem Solution Notes Test
16
A
B B
C C C
D D D D
E E E E E
Problem Solution Notes Test
17
        A
A B A
A B C B A
A B C D C B A
A B C D E D C B A
Problem Solution Notes Test
18
E
D E
C D E
B C D E
A B C D E
Problem Solution Notes Test
19
* * * * * * * * * *
* * * * * * * *
* * * * * *
* * * *
* *
* * * *
* * * * * *
* * * * * * * *
* * * * * * * * * *
Problem Solution Notes Test
20
*                 *
* * * *
* * * * * *
* * * * * * * *
* * * * * * * * * *
* * * * * * * *
* * * * * *
* * * *
* *
Problem Solution Notes Test
21
* * * *
* *
* *
* * * *
Problem Solution Notes Test
22
4 4 4 4 4 4 4
4 3 3 3 3 3 4
4 3 2 2 2 3 4
4 3 2 1 2 3 4
4 3 2 2 2 3 4
4 3 3 3 3 3 4
4 4 4 4 4 4 4
Problem Solution Notes Test

Testing

All the tests for the above problems are located in the tests directory and are written using Jest.

Running Tests

To run tests for all the pattern problems:

npx jest

To run a specific test:

npx jest -- --findRelatedTests tests/filename.test.js

Replace filename.test.js with the name of the specific test file you want to run.

For example:

npx jest -- --findRelatedTests tests/Pattern_05.test.js

If you don't have a package.json file:

  1. You can create it using the following command:

    npm init -y
  2. Add the following configuration to your package.json:

    "directories": {
        "test": "tests"
    }
  3. Run tests using the commands mentioned above.