* [mypy] Fix type annotation in euler_method.py
In line with issue #4052.
* updating DIRECTORY.md
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* New solution for Euler problem 67
A faster and memory efficient solution based on the template of sol1.py.
Modified the solution to be more memory efficient while reading and generating the array
and during the solution finding.
No conditions and straightforward logic.
* added return type hint
* Update project_euler/problem_067/sol2.py
Preferring comprehensions over map
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update sol2.py
Self explanatory variable names
* Updated sol2 to problem 067 in directory
* Update project_euler/problem_067/sol2.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update project_euler/problem_067/sol2.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Fixed extra line
Co-authored-by: Christian Clauss <cclauss@me.com>
* [mypy] Fix type annotations for binary tree traversals in data structures
* Change variable name and update level_order_1 to use a deque
Using a deque instead of a list here, because since we are removing from the beginning of the list, the deque will be more efficient.
* remove duplicate function
* Update data_structures/binary_tree/binary_tree_traversals.py
Co-authored-by: John Law <johnlaw.po@gmail.com>
* fix function name at line 137
* Update data_structures/binary_tree/binary_tree_traversals.py
Co-authored-by: John Law <johnlaw.po@gmail.com>
* Update data_structures/binary_tree/binary_tree_traversals.py
Co-authored-by: John Law <johnlaw.po@gmail.com>
* Remove type alias and use the new syntax
* Update data_structures/binary_tree/binary_tree_traversals.py
Co-authored-by: John Law <johnlaw.po@gmail.com>
* Remove prints inside functions and return lists
Co-authored-by: John Law <johnlaw.po@gmail.com>
* Rewrite parts of Vector and Matrix methods
* Refactor determinant method and add unit tests
Refactor determinant method to create separate minor and cofactor
methods.
Add respective unit tests for new methods.
Rename methods using snake case to follow Python naming conventions.
* Reorganize Vector and Matrix methods
* Update linear_algebra/README.md
Co-authored-by: John Law <johnlaw.po@gmail.com>
* Fix punctuation and wording
* Apply suggestions from code review
Co-authored-by: John Law <johnlaw.po@gmail.com>
Co-authored-by: John Law <johnlaw.po@gmail.com>
* Added physical pressure units
This uses tuple pair which stores units required to be converted to respective other units as mentioned.
Available Units:- Pascal,Bar,Kilopascal,Megapascal,psi(pound per square inch),inHg(in mercury column),torr,atm
* Formatted file
File was formatted as per repo rules
* Reformatted file :)
* Added more reference
* More reference added
* Added solution for probelm_686 of project_euler
* Changed documentation and formatting.
* Added ref link to optimization logic
* Update project_euler/problem_686/sol1.py
Co-authored-by: John Law <johnlaw.po@gmail.com>
Co-authored-by: John Law <johnlaw.po@gmail.com>
* Financial: principle -> principal
The originally invested amount of money: `principal`
-- https://www.grammarly.com/blog/principle-principal/
* updating DIRECTORY.md
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Added volume conversions
This is a file which has relevant function which helps in conversion between volume units.
Available Units:- Cubic metre,Litre,KiloLitre,Gallon,Cubic yard,Cubic foot,cup
The file is also written in a way that , adding a new unit can easily be done by modifying tuple available in the source code
* Formatted file
The file was formatted to follow the syntax formatting rules of the repo
* Formatted file further
* Fix validate_initial_digits of credit_card_validator.py
@Bhargavishnu I think that I broke the logic of validate_initial_digits which should require that credit_card_number[0] is 3 before checking that credit_card_number[1] is 4, 5, or 7. Please verify the new changes and the new test cases to make sure that this is correct. Thanks!
* updating DIRECTORY.md
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* add an algorithm to spin some words
* Update index.py
* Adding type hint of spin_words function
* Update and rename python_codewars_disemvowel/index.py to strings/reverse_long_words.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* added complete graph generator function
* added doctest, type hints, wikipedia explanation
* added return type hint for function complete_graph
* added descriptive name for the parameter: n
* random graph generator with doctest and type hints
* validated using pre-commit
* Delete complete_graph_generator.py
* fixed doctest
* updated following reviews
* simplified the code following reviews
* fixed doctest and solved consistency issues
* consistency fixes
* Updated Pop function
Added underflow condition
* Update Pop Function
Added condition to check underflow of stack
* Update stack.py
* if not self.stack: raise StackUnderflowError
* Add doctests
* StackUnderflowError
* ..., not ....
* Update stack.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Added new file: nasa_data.py
* Modified as per review
* Minor change
* print(get_archive_data("apollo 2011")["collection"]["items"][0]["data"][0]["description"])
* Update nasa_data.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* add check_cycle.py
* Update graphs/check_cycle.py
Co-authored-by: John Law <johnlaw.po@gmail.com>
* Update check_cycle.py
* Apply suggestions from code review
Co-authored-by: John Law <johnlaw.po@gmail.com>
Co-authored-by: Christian Clauss <cclauss@me.com>