* change doctest line
import doctest is not relevant with algorithms. move it under main section.
* from doctest import testmod
Co-authored-by: Christian Clauss <cclauss@me.com>
* added __len__ function
Added a function to count number of nodes in linked list
* Updated __len__ method
used snake_case instead of camel case
* Add tests to __len__()
Co-authored-by: Christian Clauss <cclauss@me.com>
* Added file aliquot_sum.py containing a function to find theo
* Added parameter type info to aliquot_sum.py
* Update maths/aliquot_sum.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update maths/aliquot_sum.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Updated code to raise ValueErrors if input is bad
* Fixed logical operators
* Removed unnecessary import
* Updated aliquot_sum.py
* fixed formatting
* fixed documentation
Co-authored-by: Christian Clauss <cclauss@me.com>
* improved prime number generator to check only up to sqrt(n) instead of n
* added old version as slow_primes() and named new, faster version primes()
* fixed docstring in slow_primes
* Add a timeit benchmark
* Update prime_numbers.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Fix astar
Single character variable names are old school.
* fixup! Format Python code with psf/black push
* Tuple
* updating DIRECTORY.md
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Travis CI: Strict flake8
Turn the screws all the way down.
* updating DIRECTORY.md
* Switch from flake8 --select to --ignore
* Quotes
* IGNORE=E123,E203,E265,E266,E302,E401,E402,E712,E731,E741,E743,F811,F841,W291,W293,W503
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Added more flexibility to functions, decreased amount of repeating code
* Added docstrings
* Updated input functions
* Added doctests
* removed test piece of code
* black .
* Updated caesar cipher standard alphabet to fit python 3.8
* Update and rename sleepsort.py to sleep_sort.py
* Or 4
Co-authored-by: Christian Clauss <cclauss@me.com>
* added sleepsort
Adding sleepsort
* Add doctest and typing for sleepsort
* Use self-descriptive variable name
* Update sleepsort.py
* Update sorts/sleepsort.py
Co-authored-by: John Law <johnlaw.po@gmail.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
* Added Shortest Job First Algorithm
It is in IPYNB format but the dataframes are really looking good.
Please, take a look.
* Delete Shortest_Job_First_Algorithm.ipynb
* Added Shortest Job First Algorithm
* Update Shortest_Job_First Algorithm.py
* Update Shortest_Job_First Algorithm.py
* Update Shortest_Job_first Algorithm
* Added Shortest_Job_First Algorithm
* Added Shortest Job First Algorithm
* Update shortest_job_first_algorithm.py
* Format code with psf/black
Co-authored-by: Christian Clauss <cclauss@me.com>
* Added Lstm example for stock predection
* Changes after review
* changes after build failed
* Add Kiera’s to requirements.txt
* requirements.txt: Add keras and tensorflow
* psf/black
Co-authored-by: Christian Clauss <cclauss@me.com>
* added decrypt_caesar_with_chi_squared.py and ran all checks
* Updated default parameters
Removed mistake with mutable default arguments
Co-authored-by: Christian Clauss <cclauss@me.com>
* Updated handling for optional arguments
Co-authored-by: Christian Clauss <cclauss@me.com>
* Changed return statement to tuple
Made function return a tuple instead of a list
* Added more doctests
* Fixed spelling mistakes
* black . - reformatted decrypt_caesar_with_chi_squared.py
* Updated if statements to fit the updated code
* Minimized amount of lines in the code.
Co-authored-by: Christian Clauss <cclauss@me.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>
* Fix psf/black issues than fail the build
* fixup! Format Python code with psf/black push
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>
* enhanced segment tree implementation and more pythonic
enhanced segment tree implementation and more pythonic
* add doctests for segment tree
* add type annotations
* unified processing sum min max segment tre
* delete source encoding in segment tree
* use a generator function instead of returning
* add doctests for methods
* add doctests for methods
* add doctests
* fix doctest
* fix doctest
* fix doctest
* fix function parameter and fix determine conditions
* Update close comment
* Update stale.yml
* Multiline strings in yaml files
https://yaml-multiline.info/
Co-authored-by: John Law <johnlaw.po@gmail.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
* Create breadth_first_search_shortest_path.py
* updating DIRECTORY.md
* Reduce side effect of `shortest_path`
For the sake of future testing and documentation -
* fixup! Format Python code with psf/black push
* Fix typo `separately`
* Change to get() from dictionary
Co-Authored-By: Christian Clauss <cclauss@me.com>
* Move graph to the top
* fixup! Format Python code with psf/black push
* Add doctest for shortest path
* Add doctest for BFS
* fixup! Format Python code with psf/black push
* Add typings for breadth_first_search_shortest_path
* fixup! Format Python code with psf/black push
* Remove assert from doctests
* Add blank line to doctest
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: John Law <johnlaw.po@gmail.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: John Law <johnlaw@linux.com>
* A1Z26 Cipher
* A1Z26 Cipher
* Added type hints
* Added Doctests
* removed tabs, spaces instead
* corrected doctest
* corrected doctest
* info URLs added
* Condensed decode to one line
* Condensed encode function to a single line
* Nice one!
Co-authored-by: Christian Clauss <cclauss@me.com>
* Create one_dimensional.py
* Update cellular_automata/one_dimensional.py
Co-Authored-By: Christian Clauss <cclauss@me.com>
* Update cellular_automata/one_dimensional.py
Co-Authored-By: Christian Clauss <cclauss@me.com>
* Update one_dimensional.py
Moved import to the top so that the type Image gets recognized
* Update one_dimensional.py
* Update cellular_automata/one_dimensional.py
* Update cellular_automata/one_dimensional.py
* Update one_dimensional.py
* Update one_dimensional.py
* Update one_dimensional.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* fix: space count in strings/word_occurrence.py
* Update strings/word_occurrence.py
Co-Authored-By: Christian Clauss <cclauss@me.com>
* Update strings/word_occurrence.py
Co-Authored-By: Christian Clauss <cclauss@me.com>
* Update strings/word_occurrence.py
Co-Authored-By: Christian Clauss <cclauss@me.com>
* Update word_occurrence.py
Seems like, there is no need o `occurrence.pop('', None)`
Co-authored-by: Christian Clauss <cclauss@me.com>