* feat: Binary tree node sum (#7020)
* feat: Sum of all nodes in binary tree explanation (#7020)
* [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_node_sum.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* refactor: Change replace method with `__iter__` overriding (#7020)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
* Binary Search Tree Inorder Traversal
* updating DIRECTORY.md
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Binary Search Tree Inorder Traversal v2
* Binary Search Tree Inorder Traversal
* Binary Search Tree Inorder Traversal
* Update inorder_tree_traversal_2022.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update inorder_tree_traversal_2022.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update inorder_tree_traversal_2022.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update data_structures/binary_tree/inorder_tree_traversal_2022.py
* Update data_structures/binary_tree/inorder_tree_traversal_2022.py
* Updated
* Updated
* Update inorder_tree_traversal_2022.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update inorder_tree_traversal_2022.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update data_structures/binary_tree/inorder_tree_traversal_2022.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Updated and removed print statement
removed the print from inorder function
* [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>
Co-authored-by: Christian Clauss <cclauss@me.com>
* Add Catalan number to maths
* 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>
* renames prime functions and occurances in comments
* changes implementation of primality testing to be uniform
* adds static typing as per conventions
* updating DIRECTORY.md
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Get rid of the Union
* updating DIRECTORY.md
* Get rid of the Union
* Remove the redundant pre-commit runs.
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Added average absolute deviation
* Formats program with black
* reruns updated pre commit
* Update average_absolute_deviation.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* The black formatter is no longer beta
* pre-commit autoupdate
* pre-commit autoupdate
* Remove project_euler/problem_145 which is killing our CI tests
* updating DIRECTORY.md
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Fix type annotations for linked_stack.py
* Replace Optional with inline union type
* Rename linked_stack to stack_with_singly_linked_list
* Rename stack_using_dll to stack_with_doubly_linked_list
* updating DIRECTORY.md
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* [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>
* 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>
* 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>
* fix: fix mypy errors
Update binary_search_tree `arr` argument to be typed as a list
within `find_kth_smallest` function
Update return type of `merge_two_binary_trees` as both inputs can
be None which means that a None type value can be returned from
this function
* updating DIRECTORY.md
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>