* 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>
* requirements: add qiskit
major library required for quantum computing
* quantum: add quantum ripple adder implementation
right now we are essentially performing the same task as a classic ripple adder
Signed-off-by: rupansh-arch <rupanshsekar@hotmail.com>
* Add project euler problem 50
* Apply format changes
* Descriptive function/parameter name and type hints
Co-authored-by: Dhruv Manilawala <dhruvmanila@gmail.com>
Name: Prime square remainders
Let pn be the nth prime: 2, 3, 5, 7, 11, ..., and
let r be the remainder when (pn−1)^n + (pn+1)^n is divided by pn^2.
For example, when n = 3, p3 = 5, and 43 + 63 = 280 ≡ 5 mod 25.
The least value of n for which the remainder first exceeds 10^9 is 7037.
Find the least value of n for which the remainder first exceeds 10^10.
Reference: https://projecteuler.net/problem=123
reference: #2695
Co-authored-by: Ravi Kandasamy Sundaram <rkandasamysundaram@luxoft.com>
* Added solution to Euler 64.
Added Python solution to Project Euler Problem 64.
Added a folder problem_064.
Added __init__.py file.
Added sol1.py file.
* Update sol1.py
Made formatting changes as mentioned by pre-commit
* Update sol1.py
Minor changes to variable naming and function calling as mentioned by @ruppysuppy
* Update sol1.py
Changes to function call as mentioned by @cclauss
* Added a solution for Project Euler Problem 203 (https://projecteuler.net/problem=203)
* Simplified loop that calculates the coefficients of the Pascal's Triangle. Changes based on review suggestion.
* Moved get_squared_primes_to_use function outside the get_squarefree function and fixed a failing doctest with the former.
* kth order statistics divide and conquer algorithm
* add explanation of algorithm.
* fix PEP8 line too long error
* update order to be compliant to isort
* add doctest
* make file black compliant
* Added solution to Project Euler problem 301
* Added newline to end of file
* Fixed formatting and tests
* Changed lossCount to loss_count
* Fixed default parameter value for solution
* Removed helper function and modified print stmt
* Fixed code formatting
* Optimized solution from O(n^2) to O(1) constant time
* Update sol1.py
* add type hints to math/gcd
* add doctest
* math/gcd - run black formatter
* math/gcd: remove manual doctest
* add correction to gcd of negative numbers
* add more doctest in iterative gcd
* 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>
* Implement the melkman anlgorithm for computing convex hulls
* Link melkman algorithm description
* Format melkman algorithm code
* Add type hints to functions
* Fix build errors
* Made improvements to combinations.py
* Update maths/combinations.py
Co-authored-by: Du Yuanchao <shellhub.me@gmail.com>
* Function now raises an error when given invalid input
* Update maths/combinations.py
Co-authored-by: Du Yuanchao <shellhub.me@gmail.com>
* Update CONTRIBUTING.md
Needed to tell people so we do not receive any duplicate solution. Do not count this as hactoberfest-accepted
* Update CONTRIBUTING.md
* Update CONTRIBUTING.md
typo fix
Co-authored-by: Du Yuanchao <shellhub.me@gmail.com>
* Update CONTRIBUTING.md
Co-authored-by: Du Yuanchao <shellhub.me@gmail.com>
Co-authored-by: John Law <johnlaw.po@gmail.com>
* Fix style of the first ten solutions for Project Euler
- Unify the header docstring, and add reference URLs to wikipedia
or similar
- Fix docstrings to be properly multilined
- Add newlines where appropriate
- Add doctests where they were missing
- Remove doctests that test for the correct solution
- fix obvious spelling or grammar mistakes in comments and
exception messages
- Fix line endings to be UNIX. This makes two of the files seem
to have changed completely
- no functional changes in any of the solutions were done
(except for the spelling fixes mentioned above)
* Fix docstrings and main function as per Style Guide
* add forecasting code
* add statsmodel
* sort import
* sort import fix
* fixing black
* sort requirement
* optimize code
* try with limited data
* sort again
* sort fix
* sort fix
* delete warning and black
* add code for forecasting
* use black
* add more hints to describe
* add doctest
* finding whitespace
* fixing doctest
* delete
* revert back
* revert back
* revert back again
* revert back again
* revert back again
* try trimming whitespace
* try adding doctypeand etc
* fixing reviews
* deleting all the space
* fixing the build
* delete x
* add description for safety checker
* deleting subscription integer
* fix docthint
* make def to use function parameters and return values
* make def to use function parameters and return values
* type hints on data safety checker
* optimize code
* Update run.py
Co-authored-by: FVFYK3GEHV22 <fvfyk3gehv22@FVFYK3GEHV22s-MacBook-Pro.local>
Co-authored-by: Christian Clauss <cclauss@me.com>
* Added solution for Project Euler problem 38. Fixes: #2695
* Update docstring and 0-padding in directory name. Reference: #3256
* Renamed is_9_palindromic to is_9_pandigital.
* Changed just-in-case return value for solution() to None.
* Moved exmplanation to module-level docstring and deleted unnecessary import