🤓
GeeksForGeeks problem solutions
Description
Collection of solutions for GeeksForGeeks problems. Solutions are written in latest version of Python programming language.
Directory structure
Below is a sample structure to understand the categorization of solutions.
├── features
│ ├── maximum_in_struct_array_works.feature
│ ├── step_definitions
│ └── support
│ ├── env.rb
── programs
│ ├── arrays
│ │ ├── maximum_in_struct_array.py
│ └── tests
│ └── test_arrays
-
features
: A cucumber based functional test cases for each solution of the program. Test cases for each program is post-fixed with.feature
. The filefeatures/maximum_in_struct_array_works.feature
is a end to end test case forprograms/arrays/maximum_in_struct_array.py
. -
program
: A top level directory where solutions to all the problems are stored. Child of this directory is a category directory or a test directory. -
arrays
: Directory name is the Category of the problem. Child of this directory is solutions for a problems which are under arrays category. Because of space constraint, I am not explaining each and every category. -
maximum_in_struct_array.py
: Name of the file is a title of the problem. Problems are child of category directory. -
tests
: Test is a possible director which contains unit level of tests for all the problems. -
test_arrays
: Child directory for test cases of dedicated category. It is prefixed withtest_*
where last part is the name of the category. Child of this directory is a collection of unit tests for individual problem.
Dependencies
Run
End to end tests
Build
Programs
pipenv shell
This command will activate a virtual environment. Make sure pipenv is already installed.
pipenv install
This command will install the Python dependencies. The source code of the program solutions is not dependent on any of these Python dependencies. The code of unit tests and end to end tests is dependent on a few Python libraries.
End to end tests
make build-dev
This command will intall dependencies to run the end to end tests. Make sure Ruby and RubyGem is installed on your workstation.
Commands
make unit-test
This command will run the unit tests for all the solutions.
make end-to-end-tests
This command will run end to end test for all the programs.
How to run a sultion program?
If you want to run the solution for Arrays -> Maximum In Struct Array problem, you should follow below steps.
- Activate the virtual environment using
pipenv shell
. - Move to
programs/arrays
directory. - Fire this command to run the program
python maximum_in_struct_array.py
.