* Added cosine similarity
* [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>
* Resonant Frequency
* Resonant Frequency of LC Circuit
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update electronics/resonant_frequency.py
Co-authored-by: Caeden <caedenperelliharris@gmail.com>
* Update electronics/resonant_frequency.py
Co-authored-by: Caeden <caedenperelliharris@gmail.com>
* Update electronics/resonant_frequency.py
Co-authored-by: Caeden <caedenperelliharris@gmail.com>
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Updated resonant_frequency.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update electronics/resonant_frequency.py
Co-authored-by: Paul <56065602+ZeroDayOwl@users.noreply.github.com>
* Fixed doctest issues in resonant_frequency.py
* Algorithm for Electrical Impedance
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Updated Algorithm for Electrical Impedance
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update resonant_frequency.py
* Update electrical_impedance.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update resonant_frequency.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update electronics/electrical_impedance.py
Co-authored-by: Paul <56065602+ZeroDayOwl@users.noreply.github.com>
* Update electronics/electrical_impedance.py
Co-authored-by: Paul <56065602+ZeroDayOwl@users.noreply.github.com>
* Update electronics/resonant_frequency.py
Co-authored-by: Paul <56065602+ZeroDayOwl@users.noreply.github.com>
* [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 <caedenperelliharris@gmail.com>
Co-authored-by: Paul <56065602+ZeroDayOwl@users.noreply.github.com>
* Added Viterbi algorithm Fixes: #7465
Squashed commits
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Added doctest for validators
* moved all extracted functions to the main function
* Forgot a type hint
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Add files via upload
* Delete permutations.cpython-310.pyc
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update permutations.py
* Update permutations.py
* Add files via upload
* Delete permutations.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update permutations.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update permutations.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update permutations.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update data_structures/arrays/permutations.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update permutations.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update permutations.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update data_structures/arrays/permutations.py
Co-authored-by: Chris O <46587501+ChrisO345@users.noreply.github.com>
* Update permutations.py
* Update permutations.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update permutations.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>
Co-authored-by: Chris O <46587501+ChrisO345@users.noreply.github.com>
* Create recursive_approach_knapsack.py
Added a new naïve recursive approach to solve the knapsack problem.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update recursive_approach_knapsack.py
Updated the code
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update recursive_approach_knapsack.py
Updated
* [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>
* Update password_generator.py
1. Use secrets module instead of random for passwords as it gives a secure source of randomness
2. Add type annotations for functions
3. Replace ctbi (variable for the characters to be included) with a more meaningful and short name
4. Use integer division instead of obtaining the integer part of a division computing a floating point
* [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 centripetal_force.py
Centripetal force is the force acting on an object in curvilinear motion directed towards the axis of rotation or centre of curvature.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update centripetal_force.py
The value error should also handle negative values of the radius and using more descriptive names will be more beneficial for the users
* Update centripetal_force.py
Made some bug fixes
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: SparshRastogi <75373475+SparshRastogi@users.noreply.github.com>
* Create potential_energy.py
Finding the gravitational potential energy of an object with reference to the earth, by taking its mass and height above the ground as input
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update physics/potential_energy.py
Co-authored-by: Chris O <46587501+ChrisO345@users.noreply.github.com>
* Update physics/potential_energy.py
Co-authored-by: Chris O <46587501+ChrisO345@users.noreply.github.com>
* Update physics/potential_energy.py
Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>
* Update physics/potential_energy.py
Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>
* Update physics/potential_energy.py
Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>
* Update physics/potential_energy.py
Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>
* Update physics/potential_energy.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
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: Caeden Perelli-Harris <caedenperelliharris@gmail.com>
* Cleanup the BFS
* Add both functions and timeit
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Add performace results as comment
* Update breadth_first_search_2.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>
* Create combination_sum_iv.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update dynamic_programming/combination_sum_iv.py
Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>
* Update dynamic_programming/combination_sum_iv.py
Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>
* Update dynamic_programming/combination_sum_iv.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
* Update combination_sum_iv.py
* Update combination_sum_iv.py
* Resolved PR Comments
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* minor change, argument missing in function
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update dynamic_programming/combination_sum_iv.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* minor change
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>
* Update maximum_subarray.py
1. Rectify documentation to indicate the correct output: function doesn't return the subarray, but rather returns a sum.
2. Make the function more Pythonic and optimal.
3. Make function annotation generic i.e. can accept any sequence.
4. Raise value error when the input sequence is empty.
* Update maximum_subarray.py
1. Use the conventions as mentioned in pep-0257.
2. Use negative infinity as the initial value for the current maximum and the answer.
* Update maximum_subarray.py
Avoid type conflict by returning the answer cast to an integer.
* Update other/maximum_subarray.py
Co-authored-by: Andrey <Cjkjvfnby@gmail.com>
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update maximum_subarray.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update maximum_subarray.py
Remove typecast to int for the final answer
Co-authored-by: Andrey <Cjkjvfnby@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Create fetch_amazon_product_data.py
This file provides a function which will take
a product name as input from the user,and fetch the necessary
information about that kind of products from Amazon like the product
title,link to that product,price of the product,the ratings of
the product and the discount available on the product
in the form of a csv file,this will help the users by improving searchability
and navigability and find the right product easily and in a short period of time,
it will also be beneficial for performing better analysis on products
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update fetch_amazon_product_data.py
Added type hints and modified files to pass precommit test
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update fetch_amazon_product_data.py
Added type hints and made changes to pass the precommit
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update fetch_amazon_product_data.py
Modified function to return the data in the form of Pandas Dataframe,modified type hints and added a functionality to let the user determine if they need the data in a csv file
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update fetch_amazon_product_data.py
Made some bug fixes
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update and rename fetch_amazon_product_data.py to get_amazon_product_data.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update get_amazon_product_data.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>
* Implemented Swish Function
* Added more description and return hint in def
* Changed the name and added more descrition including test for sigmoid function
* Added * in front of links
* Adopt Python >= 3.8 assignment expressions using auto-walrus
* updating DIRECTORY.md
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* feat: Implement binary tree path sum (#7135)
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update data_structures/binary_tree/binary_tree_path_sum.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* refactor: Rename `dfs` to `depth_first_search`
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
* Refactoring the syntax using list comprehension
* Update detecting_english_programmatically.py
* Update detecting_english_programmatically.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Remove unnecessary else statement
* [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>
* Spheres union
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update volume.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update volume.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* f-strings
* Update maths/volume.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* more tests
* fix non negative
* fix 0 radius
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fix tests
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fix tests
* fix print
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fix comment
* fix comment
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update volume.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>
* Create malus_law.py
Finding the intensity of light transmitted through a polariser using Malus Law and by taking initial intensity and angle between polariser and axis as input
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update physics/malus_law.py
Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>
* Update physics/malus_law.py
Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>
* Update physics/malus_law.py
Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>
* Update physics/malus_law.py
Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>
* Update malus_law.py
Made some changes in the error messages and the docstring testcases
* Update malus_law.py
Made changes for the passing the precommit
* [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>
* Calculate GST Amount
The program helps to get the net amount after GST is added to it.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update financial/calculating GST.py
Thanks!
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update and rename calculating GST.py to price_plus_tax.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update price_plus_tax.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>
* Create minimums_squares_to_represent_a_number.py
added a dynamic programming approach of finding the minimum number of square to represent a number.
eg :
25 = 5*5
37 = 6*6 + 1*1
21 = 4*4 + 2*2 + 1*1
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update and rename minimums_squares_to_represent_a_number.py to minimum_squares_to_represent_a_number.py
updated the code
* Update minimum_squares_to_represent_a_number.py
I have added the appropriate checks for 0 and 12.34.
It would be great if you could suggest a name for the dp array
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update minimum_squares_to_represent_a_number.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update minimum_squares_to_represent_a_number.py
updated
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update minimum_squares_to_represent_a_number.py
updated
* [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>
* added support for inverse of 3x3 matrix
* Modified Docstring and improved code
* fixed an error
* Modified docstring
* Apply all suggestions from code review
Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>
Co-authored-by: Chris O <46587501+ChrisO345@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>
Co-authored-by: Chris O <46587501+ChrisO345@users.noreply.github.com>
* Added function that checks if a string is an isogram.
* Added wiki reference and fixed comments.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Made function name more self-documenting. Raise ValueError if string contains 1 or more digits. Renamed file. Lowercase string inside function.
* Removed check_isogram.py (file renamed).
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fixed test failure.
* Raise ValueError when string has non-alpha characters. Removed import.
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Included area of n sided regular polygon
Added a function to calculate the area of n sided regular polygons
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* code standard fixes as per PR comments
* [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>
* added script for solving system of linear equations in two variables
* implemented all the suggested changes
* changed RuntimeError to ValueError
* Update matrix/system_of_linear_equation_in_2_variables.py
* Update matrix/system_of_linear_equation_in_2_variables.py
* Update and rename system_of_linear_equation_in_2_variables.py to cramers_rule_2x2.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Updated documentation of cnn_classification.py for much better understanding
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update computer_vision/cnn_classification.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: Caeden Perelli-Harris <caedenperelliharris@gmail.com>