* 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
* Add solution for Project Euler 65,
* Add URL to problem 65 and don't pass in parameter to solution()
* Remove solution() tests
* Add tests for solution(), add fstring and positional arg for solution
* Rename directory and problem number to 065
* Remove directory
* Move up explanation to module code block
* Move solution() below helper function, rename variables
* update doubly linked list
* reformat code
add more test
* add test to iter
* updating DIRECTORY.md
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Create medianOf TwoArrays.py
This code finds the median of two arrays (which may or may not be sorted initially).
Example:
Enter elements of an array: 1 5 4 2
Enter elements of another array: 1 7 4 2 7
The median of two arrays is : 4
* Rename medianOf TwoArrays.py to median_of _two_arrays.py
* Rename median_of _two_arrays.py to median_of_two_arrays.py
* Update median_of_two_arrays.py
* Update median_of_two_arrays.py
* Update median_of_two_arrays.py
* Update median_of_two_arrays.py
* Update median_of_two_arrays.py
* Update median_of_two_arrays.py
* Update median_of_two_arrays.py
* Update median_of_two_arrays.py
* Update median_of_two_arrays.py
* Update median_of_two_arrays.py
* Update median_of_two_arrays.py
* Update median_of_two_arrays.py
* Update median_of_two_arrays.py
* Update median_of_two_arrays.py
* Update median_of_two_arrays.py
* Update median_of_two_arrays.py
* Update median_of_two_arrays.py
* Add naive recursive implementation of 0-1 Knapsack problem
* Fix shadowing
* Add doctest
* Fix type hints
* Add link to wiki
* Blacked the file
* Fix isort
* Move knapsack / add readme and more tests
* Add missed main in tests
* Add Patience Sort
* fix code for pre-commit
* Fix params def
* Adding new line at end of file
* Remove Trailing Whitespace
* Adding space between the methods of the Stack class
* Removing Trailing Whitespace
* Ordering Imports
* Adding url patience sort
Co-authored-by: jvnascimento <nascimento783@gmail.com>
* create beaufort cipher
if you like my code, merge it and add the label as `hacktoberfest-accepted`
* update the file
* Update beaufort_cipher.py
* Update beaufort_cipher.py
* update as per black formatter
* Update beaufort_cipher.py
* update the file
* update file
* update file
* update file
* update file
* Add GitHub action for Project Euler only
* Add second job for Project Euler
* Remove Project Euler jobs from Travis CI
* Fix typo for actions/setup-python
* Rename the workflow file
* Change name of file in workflow
* Remove comments from Travis config file
* Create evaluate_postfix_notations.py
Adding in the evaluate postfix notation using Stacks
one of the common use with simple stack question
creating a new file for the data structure of stacks
* Create evaluate_postfix_notations.py
Adding in the evaluate postfix notation using Stacks
one of the common use with simple stack question
creating a new file for the data structure of stacks
* Delete evaluate_postfix_notations.py
* Evaluate postfix expression stack clean approach
Sending in the PR again as the Previous request failed in pre commit
* Update evaluate_postfix_notations.py
* Update evaluate_postfix_notations.py
Made changes as per the required for fixing the failing pre-commits.
* Update evaluate_postfix_notations.py
Made changes as suggested by @cclauss
* Update evaluate_postfix_notations.py
fixed pre-commit fails
* Update evaluate_postfix_notations.py
fixing pre-commit fails
* Update evaluate_postfix_notations.py
Deleted trailing white spaces causing pre-commits to fail
* Update data_structures/stacks/evaluate_postfix_notations.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update data_structures/stacks/evaluate_postfix_notations.py
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
* include solution for problem 57
* fix line to long errors
* update filenames and code to comply with new regulations
* more descriptive local variables
* Added solution for Project Euler problem 75.
* Added doctest for solution() in project_euler/problem_75/sol1.py
* Update docstring and 0-padding of directory name. Reference: #3256
* More descriptive variable names
* Moved solution explanation to module-level docstring
* Added solution for Project Euler problem 72.
* Update type annotations and 0-padding of the directory name. Reference: #3256
* Rename sol1.py to sol2.py
* Added newline at the end of sol2.py
* Revert sol1.py
* graphs/kruskal: add doctest & type hints
this is a child of a previous PR #2443
its ancestor is #2128
* updating DIRECTORY.md
* graphs/kruskal: fix max-line-length violation
* fixup! Format Python code with psf/black push
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Added solution for Project Euler problem 74. Fixes: #2695
* Added doctest for solution() in project_euler/problem_74/sol1.py
* Update docstrings and 0-padding of directory name. Reference: #3256
* Tighten up quicksort()
* updating DIRECTORY.md
* str does not support .pop()
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Revert recent changes to .pre-commit-config.yaml
We must continue to insist that algorithmic functions can not print() as discussed in CONTRIBUTING.md.
* updating DIRECTORY.md
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Update mergesort.py
1) Updating the merge sort in python as the previous implementation was modifying the input array
2) divided the division part and conquer part of the merge sort algorithm as 2 functions namely mergeSort and merge.
3) function mergeSort divides the function into halves i.e the purpose of the function will be to divide the array
4) function merge will merge 2 halves into a sorted array
5)Added random test cases using shuffle as suggested by @dhruvmanila
6 The time and space complexity of the previous and my version remains the same. i.e (n log(n) time and n log(n) space
7) changed variables as per the python case as required and suggested by @dhruvmanila
8) Updated function names as suggested by @dhurvmanila
* Update mergesort.py
Added in few more test cases
added type hints for the functions and parameters as suggested by @dhruvmanila
formatted the code using Auto Pep8
* Update mergesort.py
update and added new testcases
* Update mergesort.py
Added in doc test in merge function
* Update mergesort.py
fixing pre-commit fails
* Update mergesort.py
Co-authored-by: Dhruv <dhruvmanila@gmail.com>
* Rename all Project Euler directories:
Reason:
The change was done to maintain consistency throughout the directory
and to keep all directories in sorted order.
Due to the above change, some config files had to be modified:
'problem_22` -> `problem_022`
* Update scripts to pad zeroes in PE directories