- Add default arguments to solution function
- Add link to Project Euler problem 6
- Add doctest for testing `solution()`
- Removed test_solutions.py as it is redundant
* add typehints and docstrings
* add typehint and default value
* add typehint and default value. Removed unused variable.
* do not modifiy the given solution
* add doctests
* update sol1 after running black
* add typehint, docstring, and doctest
* update sol2 after running black
* Fix typehints in project_euler/problem01
Squashed commit of the following:
commit 6801d073b31bf702814861cd3b07b634ca295bfa
Author: Archaengel <god11341258@gmail.com>
Date: Mon Oct 5 16:40:10 2020 -0700
Fix typehints in project_euler/problem01
commit 29afc3af114abd1b99dc3f7c8fc99128229db131
Author: Archaengel <god11341258@gmail.com>
Date: Mon Oct 5 15:06:34 2020 -0700
Add typehints and default argument for project_euler/problem_01
* Add default args, typehints, and expand variable names for PE prob 02
* Add style improvements for first solution of PE Problem 02
* Add default arg and typehints for second solution of PE Problem 02
* Add default arg for third solution of PE Problem 02
* Add style improvements for 1st soln of PE problem 03
* Add default arg and typehints for 2nd soln of PE problem 03
* Add default arg for 3rd soln of PE problem 03
* Remove unnecessary newlines
* Remove unnecessary newlines
* Fix end of file for 2nd soln in PE problem 03
* chore: update print_reverse helper method
Use a generator expression instead of slicing
`elements_list` to improve the space and time complexity
of `make_linked_list` to O(1) space and O(n) time
by avoiding the creation a shallow copy of `elements_list`.
* fix: add type checking and argument typing
Add argument typing to all methods in `print_reverse`
Add doctest to helper function `make_linked_list` and
basic edge case tests to `print_reverse`
* test: add `print_reverse` test
Fix doctest syntax and remove edge case tests that are covered
by typed arguments.
Add `print_reverse` test that expects the correct values are printed
out by adding a `test_print_reverse_output` helper function.
* format code
Co-authored-by: shellhub <shellhub.me@gmail.com>
* Add GitHub action file for pre-commit
* Fix errors exposed by pre-commit hook:
- Remove executable bit from files without shebang. I checked those
file and it was not needed.
- Fix with black
* Apply suggestions from code review
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
* Add pre-commit basic config file
* Add pre-commit to requirements.txt
* Small tweaks and use stable for black
* Fix isort section in pre-commit-config file
* Fix errors and EOF only for Python files
* Fix all errors mentioned in pre-commit run:
- Fix end of file
- Remove trailing whitespace
- Fix files with black
- Fix imports with isort
* Fix errors
* Update sorts/quick_sort_3partition.py
Another quick sort algorithm, returns a new sorted list
* Update sorts/quick_sort_3_partition.py
rename quick_sort_3partition to quick_sort_3part
* Update sorts/quick_sort_3_partition.py
rename quick_sort_3part to three_way_radix_quicksort
Three-way radix quicksort:
https://en.wikipedia.org/wiki/Quicksort#Three-way_radix_quicksort
First divide the list into three parts.
Then recursively sort the "less than" and "greater than" partitions.
* Update sorts/quick_sort_3_partition.py
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
* Add file for testing Project Euler solutions
* Remove the importlib import
* Update project_euler/solution_test.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Small tweaks to project_euler/solution_test.py
* Test Project Euler solutions through Travis
* Improved testing for Project Euler solutions:
- Renamed file so that it isn't picked up by pytest
- Fail fast on validating solutions through Travis CI
* Update validate_solutions.py
* Use namedtuple for input parameters and answer
- Remove logging
- Remove unnecessary checks for PROJECT_EULER_PATH as Travis CI
picks up the same path
* Fix flake8 errors: line too long
* Small tweaks to validate_solutions.py
* Add all answers & back to using dictionary
* Using pytest for testing Project Euler solutions
- As we want to fail fast on testing solutions, we need to test using
this script first before we use tests written by the author.
- As pytest stops testing as soon as it receives a traceback, we need to
use pytest-subtests to tell pytest to test all the iterations for the
function with given parameters.
* Print error messages in oneline format
* Separated answers into a separate file:
- Add custom print function to print all the error messages at the
end of all the tests
- Let Travis skip if this failed
Co-authored-by: Christian Clauss <cclauss@me.com>
* Use self-documenting option instead of cryptic option
@mateuszz0000 Your review, please. Pretend that you do not know what `-L` stands for. How many keystrokes and clicks does it take to confirm the purpose of this option?
* updating DIRECTORY.md
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Update morse_code_implementation.py
Added more characters to MORSE_CODE_DICT for a more complete dictionary.
Split words with "/" instead of a space as is standard.
Fixed bug when encrypting a message with a comma.
* Fixed comment typo
* added type hints and doctests for minimax algorithm
* Update backtracking/minimax.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* last fix
Co-authored-by: Christian Clauss <cclauss@me.com>