* * rename variable
* fix type hint
* fix doctest
* added test function
* fixed import error
* fixup! Format Python code with psf/black push
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Updated problem_04 in project_euler
* fixup! Format Python code with psf/black push
* That number is larger than our acceptable range.
* updating DIRECTORY.md
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
* Create __init__.py
* Initial commit
Not sure if this should be formatted differently. I'm open to ideas!
* Completing testing/updates
Ran code through `black`, `flake8`, and `doctest`. Added some type hints.
`doctest` is finicky on sets, so I had to sort and reformat as set to pass those tests.
* Update project_euler/problem_47/sol1.py
Nice.
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update project_euler/problem_47/sol1.py
Looks good
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update project_euler/problem_47/sol1.py
Okay, this should work. Thank you for the reminder on map(), filter(), reduce().
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update project_euler/problem_47/sol1.py
My IDE needs a spellchecker. Or, lighter comment font.
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update project_euler/problem_47/sol1.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update project_euler/problem_47/sol1.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update project_euler/problem_47/sol1.py
This means that `results = run(N)` should be updated to `results = run(n)`, correct?
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update project_euler/problem_47/sol1.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update project_euler/problem_47/sol1.py
Looks good!
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update project_euler/problem_47/sol1.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update project_euler/problem_47/sol1.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update project_euler/problem_47/sol1.py
Works for me! I spent way too much time getting this to pass doctest, so any improvement is welcome.
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update sol1.py
Added some suggested changes from the pull request:
* Updated tests outputs in `unique_prime_factors` function.
* Changed `@lru_cache(maxsize=5)` to `@lru_cache(maxsize=None)`
* Removed duplicate `return` line in `equality` function
* Changed `i` to `base` in run function.
* Added some commentary to `run()` function.
* Replaced `group = list(map(lambda x: base + x, [i for i in range(n)]))` with `group = [base + i for i in range(n)]`
* Update sol1.py
* Trailing whitespace
* Update sol1.py
* Update __init__.py
* Update sol1.py
* Update __init__.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Euler problem 551 sol 1: Reduce McCabe code complexity
As discussed in #2128
* fixup! Format Python code with psf/black push
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Tighten up psf/black and flake8
* Fix some tests
* Fix some E741
* Fix some E741
* updating DIRECTORY.md
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Deal with maps
Try with the search term "pizza" to see why this was done in #1932
* fixup! Format Python code with psf/black push
* Update armstrong_numbers.py
* updating DIRECTORY.md
* Update crawl_google_results.py
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Solution for Euler Problem 26
* Update project_euler/problem_26/sol1.py
typo error fix.
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update project_euler/problem_26/sol1.py
typo error fix
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update project_euler/problem_26/sol1.py
ok to remove, this comes from Pycharm automatically when docstring is added.
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update project_euler/problem_26/sol1.py
ok to remove.
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update project_euler/problem_26/sol1.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update project_euler/problem_26/sol1.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update project_euler/problem_26/sol1.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* now_divide = now_divide * 10 % divide_by_number
Co-authored-by: Christian Clauss <cclauss@me.com>
* spelling corrections
* review
* improved documentation, removed redundant variables, added testing
* added type hint
* camel case to snake case
* spelling fix
* review
* python --> Python # it is a brand name, not a snake
* explicit cast to int
* spaces in int list
* "!= None" to "is not None"
* Update comb_sort.py
* various spelling corrections in documentation & several variables naming conventions fix
* + char in file name
* import dependency - bug fix
Co-authored-by: John Law <johnlaw.po@gmail.com>
* Create soln.py
Solution for problem 30 of Euler Project
* Update soln.py
* update soln.py
modified the changes
* if __name__ == "__main__":
Co-authored-by: Christian Clauss <cclauss@me.com>
* Add sol3 for project_euler proble_03
* Update sol3.py
add type hint
remove unused variable
* Format code with psf/black
* add sol3 to project_euler/problem_08, modify the stepsize of the loop,will be faster than sol1
* Added doctest and more explanation about Dijkstra execution.
* tests were not passing with python2 due to missing __init__.py file at number_theory folder
* Removed the dot at the beginning of the imported modules names because 'python3 -m doctest -v data_structures/hashing/*.py' and 'python3 -m doctest -v data_structures/stacks/*.py' were failing not finding hash_table.py and stack.py modules.
* Moved global code to main scope and added doctest for project euler problems 1 to 14.
* Added test case for negative input.
* Changed N variable to do not use end of line scape because in case there is a space after it the script will break making it much more error prone.
* Added problems description and doctests to the ones that were missing. Limited line length to 79 and executed python black over all scripts.
* Changed the way files are loaded to support pytest call.
* Added __init__.py to problems to make them modules and allow pytest execution.
* Added project_euler folder to test units execution
* Changed 'os.path.split(os.path.realpath(__file__))' to 'os.path.dirname()'
* Added Burrows-Wheeler transform algorithm.
* Added changes suggested by cclauss
* Fixes for issue 'Fix the LGTM issues #1024'.
* Added doctest for different parameter types and negative values.
* Fixed doctest issue added at last commit.
* Commented doctest that were causing slowness at Travis.
* Added comment with the reason for some doctest commented.
* pytest --ignore
* Added tests execution again.
* Had forgotten to add comment to file project_euler/problem_09/sol3.py
* Added doctest and more explanation about Dijkstra execution.
* tests were not passing with python2 due to missing __init__.py file at number_theory folder
* Removed the dot at the beginning of the imported modules names because 'python3 -m doctest -v data_structures/hashing/*.py' and 'python3 -m doctest -v data_structures/stacks/*.py' were failing not finding hash_table.py and stack.py modules.
* Moved global code to main scope and added doctest for project euler problems 1 to 14.
* Added test case for negative input.
* Changed N variable to do not use end of line scape because in case there is a space after it the script will break making it much more error prone.
* Added problems description and doctests to the ones that were missing. Limited line length to 79 and executed python black over all scripts.
* Changed the way files are loaded to support pytest call.
* Added __init__.py to problems to make them modules and allow pytest execution.
* Added project_euler folder to test units execution
* Changed 'os.path.split(os.path.realpath(__file__))' to 'os.path.dirname()'
* Added Burrows-Wheeler transform algorithm.
* Added changes suggested by cclauss
* Fixes for issue 'Fix the LGTM issues #1024'.
* Added doctest for different parameter types and negative values.
* Fixed doctest issue added at last commit.
* Commented doctest that were causing slowness at Travis.
* Added comment with the reason for some doctest commented.
* pytest --ignore
* Added doctest and more explanation about Dijkstra execution.
* tests were not passing with python2 due to missing __init__.py file at number_theory folder
* Removed the dot at the beginning of the imported modules names because 'python3 -m doctest -v data_structures/hashing/*.py' and 'python3 -m doctest -v data_structures/stacks/*.py' were failing not finding hash_table.py and stack.py modules.
* Moved global code to main scope and added doctest for project euler problems 1 to 14.
* Added test case for negative input.
* Changed N variable to do not use end of line scape because in case there is a space after it the script will break making it much more error prone.
* Added problems description and doctests to the ones that were missing. Limited line length to 79 and executed python black over all scripts.
* Changed the way files are loaded to support pytest call.
* Added __init__.py to problems to make them modules and allow pytest execution.
* Added project_euler folder to test units execution
* Changed 'os.path.split(os.path.realpath(__file__))' to 'os.path.dirname()'
* Added Burrows-Wheeler transform algorithm.
* Added changes suggested by cclauss
* Fixes for issue 'Fix the LGTM issues #1024'.
* Added doctest for different parameter types and negative values.
* Fixed doctest issue added at last commit.
* Added doctest and more explanation about Dijkstra execution.
* tests were not passing with python2 due to missing __init__.py file at number_theory folder
* Removed the dot at the beginning of the imported modules names because 'python3 -m doctest -v data_structures/hashing/*.py' and 'python3 -m doctest -v data_structures/stacks/*.py' were failing not finding hash_table.py and stack.py modules.
* Moved global code to main scope and added doctest for project euler problems 1 to 14.
* Added test case for negative input.
* Changed N variable to do not use end of line scape because in case there is a space after it the script will break making it much more error prone.
* Added problems description and doctests to the ones that were missing. Limited line length to 79 and executed python black over all scripts.
* Changed the way files are loaded to support pytest call.
* Added __init__.py to problems to make them modules and allow pytest execution.
* Added project_euler folder to test units execution
* Changed 'os.path.split(os.path.realpath(__file__))' to 'os.path.dirname()'
* Create text file for numbers
* Create sol2.py
* Pythonic version of Problem #16 solution
* Update sol2.py
* Valid Python code for Python version 2-3
* Update sol2.py
* iterative and formula fibonacci methods
Added two ways to calculate the fibonacci sequence: (1) iterative (2) formula.
I've also added a timer decorator so someone can see the difference in computation time between these two methods.
Added two unittests using the slash framework.
* Update test_fibonacci.py
* remove inline comments per Contributing Guidelines
* Update sol5.py
* Create placeholder.py
* Update and rename maths/test_fibonacci.py to maths/tests/test_fibonacci.py
* Delete placeholder.py
* Create __init__.py
* Update test_fibonacci.py
* Rename Maths/lucasSeries.py to maths/lucasSeries.py
* Update and rename Project Euler/Problem 01/sol5.py to project_euler/problem_01/sol6.py
* Adding variable to fade out ambiguity
* More readability on merge sorting algorithm
* Updating merge_sort_fastest description and explaining why
* Adding tests file with imports
* Standardazing filenames and function names
* Adding test cases and test functions
* Adding test loop
* Putting 'user oriented code' inside main condition for having valid imports
* Fixing condition
* Updating tests: adding cases and todo list
* Refactoring first euler problem's first solution
* Travis CI: Add more flake8 tests
* Use ==/!= to compare str, bytes, and int literals
./project_euler/problem_17/sol1.py:25:7: F632 use ==/!= to compare str, bytes, and int literals
if i%100 is not 0:
^
* Use ==/!= to compare str, bytes, and int literals
* Update sol1.py
small off by one error. Boundary condition: if len(number) =13 , we would need to check exactly 1 combination, namely number itself. However for i in range(len(number)-13): will iterate 0 times.