* Add function for xor gate
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Add test case for xor functions
* Update boolean_algebra/xor_gate.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update boolean_algebra/xor_gate.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Split long comment line into two lines
* 88 characters per line
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
* Add Spain National ID validator (#7574)
* is_spain_national_id()
* Update is_spain_national_id.py
* Some systems add a dash
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update count_number_of_one_bits.py
removed the modulo operator as it is very time consuming in comparison to the and operator
* Update count_number_of_one_bits.py
Updated with the timeit library to compare. Moreover I have updated my code which helps us in reaching the output comparatively faster.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update bit_manipulation/count_number_of_one_bits.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update count_number_of_one_bits.py
Updated the code
* Update count_number_of_one_bits.py
Updated code
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Run the tests before running the benchmarks
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* consistently
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update knapsack.py
* Update dynamic_programming/knapsack.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update knapsack.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Update comments in check_pangram.py script
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update and rename check_pangram.py to is_pangram.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
* Add web program to fetch top 10 realtime billioners using forbes API.
* Provide return type to function.
* Use rich for tables and minor refactors.
* Fix tiny typo.
* Add the top {LIMIT} in rich table title.
* Update web_programming/get_top_billioners.py
Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Change the API path.
* Update get_top_billioners.py
Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
* Create superdense_coding.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Reduced Time Complexity to O(sqrt(n))
* Added testmod
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Fixes: #{6551}
* Fixes: #{6551}
* Update xgboostclassifier.py
* Delete xgboostclassifier.py
* Update xgboostregressor.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fixes: #{6551}
* Fixes : {#6551}
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fixes: {#6551]
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update xgboostregressor.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update xgboostregressor.py
* Update xgboostregressor.py
* Fixes: { #6551}
* Update xgboostregressor.py
* Fixes: { #6551}
* Fixes: { #6551}
* Update and rename xgboostregressor.py to xgboost_regressor.py
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
* Add signum function
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Add typehints for functions
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update signum.py
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
* Created sum_of_harmonic_series.py
Here in this code the formula for Harmonic sum is not used, Sum of the series is calculated by creating a list of the elements in the given Harmonic series and adding all the elements of that list !
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update maths/sum_of_harmonic_series.py
Co-authored-by: Chris O <46587501+ChrisO345@users.noreply.github.com>
* Update maths/sum_of_harmonic_series.py
Co-authored-by: Chris O <46587501+ChrisO345@users.noreply.github.com>
* Update maths/sum_of_harmonic_series.py
Co-authored-by: Chris O <46587501+ChrisO345@users.noreply.github.com>
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update maths/sum_of_harmonic_series.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update maths/sum_of_harmonic_series.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update maths/sum_of_harmonic_series.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update sum_of_harmonic_series.py
* Add doctests
* Update sum_of_harmonic_series.py
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Chris O <46587501+ChrisO345@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
* renamed maclaurin_sin.py to maclaurin_series.py and included function for cos approximation
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* attempt to fix pytest error
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* added maclaurin_sin.py function
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* added type hints and fixed line overflows
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* removed incompatable type examples
* Update maths/maclaurin_sin.py
Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>
* changed error details
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fixed grammatical errors
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* improved function accuracy and added test case
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update maths/maclaurin_sin.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* removed redundant return
* fixed pytest
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
* Fixes: #{6551}
* Update xgboostclassifier.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update xgboostclassifier.py
* Update xgboostclassifier.py
* Update xgboostclassifier.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fixes: #{6551}
* Update xgboostclassifier.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update xgboostclassifier.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update xgboostclassifier.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update xgboostclassifier.py
* Fixes : #6551
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fixes : #6551
* Fixes : #6551
* Fixes: #6551
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update xgboostclassifier.py
* Update xgboostclassifier.py
* Update xgboostclassifier.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fixes: #6551
* Fixes#6551
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fixes: {#6551}
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fixes: {#6551}
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fixes: #6551
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* FIXES: {#6551}
* Fixes : { #6551}
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fixes : { #6551}
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fixes: { #6551]
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update xgboostclassifier.py
* Update xgboostclassifier.py
* Apply suggestions from code review
* Update xgboostclassifier.py
* Update xgboostclassifier.py
* Update xgboostclassifier.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fixes: { #6551}
* Update xgboostclassifier.py
* Fixes: { #6551}
* Update xgboostclassifier.py
* Fixes: ( #6551)
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fixes: { #6551}
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
* Create quantum_random.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update quantum_random.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update quantum_random.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update quantum/quantum_random.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update quantum/quantum_random.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update quantum/quantum_random.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update quantum_random.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update quantum_random.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* requirements.txt: Add projectq
* Update quantum_random.py
* Update quantum/quantum_random.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update quantum_random.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update quantum_random.py
* Update quantum_random.py
* Update quantum/quantum_random.py
* Update quantum/quantum_random.py
* Update quantum_random.py
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update dijkstra.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update dijkstra.py
* Update graphs/dijkstra.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update graphs/dijkstra.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update graphs/dijkstra.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update dijkstra.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update dijkstra.py
* Apply suggestions from code review
* Create dijkstra_alternate.py
* Update dijkstra.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* int(1e7)
* Update dijkstra_alternate.py
* Update graphs/dijkstra_alternate.py
* sptset --> visited
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
* Implemented Gelu Function
* Renamed file and added more description to function
* Extended the name GELU
* Update gaussian_error_linear_unit.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update gaussian_naive_bayes.py
Just adding in a final metric of accuracy to declare...
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Create minmax.py
* Update minmax.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Maximum area of island program added
* Update matrix/max_area_of_island.py
Co-authored-by: Caeden <caedenperelliharris@gmail.com>
* Update matrix/max_area_of_island.py
Co-authored-by: Caeden <caedenperelliharris@gmail.com>
* Update matrix/max_area_of_island.py
Co-authored-by: Caeden <caedenperelliharris@gmail.com>
* Review's comment resolved
* max area of island
* PR Comments resolved
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Test case fail fix
* Grammer correction
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* flake8 issue resolved
* some variable name fix
* Update matrix/max_area_of_island.py
Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>
* Update matrix/max_area_of_island.py
Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>
* PR, comments resolved
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update matrix/max_area_of_island.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update matrix/max_area_of_island.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* PR, comments resolved
* Update max_area_of_island.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Typo
Co-authored-by: Caeden <caedenperelliharris@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
* Different views of binary tree added
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* mypy errors resolved
* doc test for remaining functions
* Flake8 comments resolved
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Example moved in if block
* doctest cases added
* Cases from if block removed
* Update data_structures/binary_tree/diff_views_of_binary_tree.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update data_structures/binary_tree/diff_views_of_binary_tree.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* PR Comments resolved
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* flake8 warning resolved
* Changes revered
* flake8 issue resolved
* Put the diagrams just above the doctests
* Update diff_views_of_binary_tree.py
* Update diff_views_of_binary_tree.py
* I love mypy
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
* ci: Add ``flake8-pep3101`` plugin to ``pre-commit``
* refactor: Remove all modulo string formatting
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* refactor: Remove ``flake8-pep3101`` plugin from ``pre-commit``
* revert: Revert to modulo formatting
* refactor: Use f-string instead of `join`
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Added some more comments
added some more comments (to formulas which need it) which make the code more readable and understandable. might make a list of all the formulas on the top, later
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Apply suggestions from code review
* The order changes the result
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fix long line
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
* Create q_full_adder.py
This is for the #Hacktoberfest.
This circuit is the quantum full adder. I saw that in the repo is the half adder so I decided to build the full adder to complete the set of adders.
I hope that this is enough to be consider a contribution.
Best,
Kevin
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Erase the unused numpy library
* Create the doctest.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* doctest for negative numbers, float, etc.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>