* Add type hints, documentation and tests.
* Update searches/ternary_search.py
Sort collection and remove the assertion logic.
Co-authored-by: Christian Clauss <cclauss@me.com>
* Remove assert sorted logic.
* Add assertion list is ordered.
* updating DIRECTORY.md
* updating DIRECTORY.md
* Format with black.
* Change names of variables to descriptive names
* Remove print in doctests
* Fix variables to snake_case notation.
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* add solution to Project Euler problem 206
* Add solution to Project Euler problem 205
* updating DIRECTORY.md
* updating DIRECTORY.md
* Revert "Add solution to Project Euler problem 205"
This reverts commit 64e3d36cab.
* Revert "add solution to Project Euler problem 206"
This reverts commit 53568cf4ef.
* add solution for project euler problem 207
* updating DIRECTORY.md
* add type hint for output of helper function
* Correct default parameter value in solution
* use descriptive variable names and remove problem solution from doctest Fixes: #2695
Co-authored-by: nico <esistegal-aber@gmx.de>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Add solution for Project Euler 65,
* Add URL to problem 65 and don't pass in parameter to solution()
* Remove solution() tests
* Add tests for solution(), add fstring and positional arg for solution
* Rename directory and problem number to 065
* Remove directory
* Move up explanation to module code block
* Move solution() below helper function, rename variables
* Add Patience Sort
* fix code for pre-commit
* Fix params def
* Adding new line at end of file
* Remove Trailing Whitespace
* Adding space between the methods of the Stack class
* Removing Trailing Whitespace
* Ordering Imports
* Adding url patience sort
Co-authored-by: jvnascimento <nascimento783@gmail.com>
* Tighten up quicksort()
* updating DIRECTORY.md
* str does not support .pop()
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Revert recent changes to .pre-commit-config.yaml
We must continue to insist that algorithmic functions can not print() as discussed in CONTRIBUTING.md.
* updating DIRECTORY.md
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Add solution for Project Euler 62
* Add doctests and annotate function params and return values for get_digits()
* Add extra newline between functions to fix flake8 errors
* Add extra newlines between function names
* Add missing return type for solution()
* Remove parenthesis from if statement
* Remove parentheses from while loop
* Add to explanation and fix second Travis build
* Compress get_digits(), add tests for solution(), add fstring and positional arg for solution()
* Remove input param when calling solution()
* Remove test case for the answer
* adding solution to problem 80
* updating DIRECTORY.md
* fixing spell check
* updating sol as per comments
* Add reference link to the problem
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Dhruv <dhruvmanila@gmail.com>
* test/graphs/kruskal: adding a test case to verify the correctness of the algorithm
Fixes#2128
* grahps/kruskal: running psf/black
* graphs/kruskal: read edges in a friendlier fashion
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update minimum_spanning_tree_kruskal.py
* fixup! Format Python code with psf/black push
* Update test_min_spanning_tree_kruskal.py
* updating DIRECTORY.md
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: John Law <johnlaw.po@gmail.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.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>
* Add solution and test files for project euler 54
* Update sol1.py
* updating DIRECTORY.md
* Fix: use proper path to open files
* Commit suggestions:
- Use list comprehension instead of map
- Sort imports using isort
* Changes made as suggested (simplified a lot):
- List and set comprehension instead of itemgetter
- Using enumerate as it's easy to read
- Divided into list of card values and set of card suit as set will
remove all the duplicate values. So, no need for double indexing.
- Add test for testing multiple calls to five_high_straight function
* Add suggestions and simplified:
- Split generate_random_hands function into two:
- First will generate a random hand
- Second, which will be called, will return a generator object
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>
* * support negative number
* add different version
* fixup! Format Python code with psf/black push
* sum(int(c) for c in str(abs(n)))
* updating DIRECTORY.md
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
* PIL.Image.point() takes an int, not a float
@furkanatesli Trying to remove these warnings from our Travis CI build logs...
https://travis-ci.com/github/TheAlgorithms/Python/builds/178602503#L809
* fixup! Format Python code with psf/black push
* Revert changes to change_brightness.py
* updating DIRECTORY.md
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* black format
* updating DIRECTORY.md
* fixes
* fixup! Format Python code with psf/black push
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>