Skip to content

Commit 49d26a7

Browse files
committed
Merge branch 'master' of gh:thealgorithms/python
2 parents cbac41e + 06f01c0 commit 49d26a7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+2786
-375
lines changed

.github/stale.yml

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Configuration for probot-stale - https://github.com/probot/stale
2+
3+
# Number of days of inactivity before an Issue or Pull Request becomes stale
4+
daysUntilStale: 30
5+
6+
# Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
7+
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
8+
daysUntilClose: 7
9+
10+
# Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled)
11+
onlyLabels: []
12+
13+
# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
14+
exemptLabels:
15+
- "Status: on hold"
16+
17+
# Set to true to ignore issues in a project (defaults to false)
18+
exemptProjects: false
19+
20+
# Set to true to ignore issues in a milestone (defaults to false)
21+
exemptMilestones: false
22+
23+
# Set to true to ignore issues with an assignee (defaults to false)
24+
exemptAssignees: false
25+
26+
# Label to use when marking as stale
27+
staleLabel: stale
28+
29+
# Limit the number of actions per hour, from 1-30. Default is 30
30+
limitPerRun: 30
31+
32+
# Comment to post when removing the stale label.
33+
# unmarkComment: >
34+
# Your comment here.
35+
36+
# Optionally, specify configuration settings that are specific to just 'issues' or 'pulls':
37+
pulls:
38+
# Comment to post when marking as stale. Set to `false` to disable
39+
markComment: >
40+
This pull request has been automatically marked as stale because it has not had
41+
recent activity. It will be closed if no further activity occurs. Thank you
42+
for your contributions.
43+
44+
# Comment to post when closing a stale Pull Request.
45+
closeComment: >
46+
Please reopen this pull request once you commit the changes requested
47+
or make improvements on the code. If this is not the case and you need
48+
some help, feel free to seek help from our [Gitter](https://gitter.im/TheAlgorithms)
49+
or ping one of the reviewers. Thank you for your contributions!
50+
51+
issues:
52+
# Comment to post when marking as stale. Set to `false` to disable
53+
markComment: >
54+
This issue has been automatically marked as stale because it has not had
55+
recent activity. It will be closed if no further activity occurs. Thank you
56+
for your contributions.
57+
58+
# Comment to post when closing a stale Issue.
59+
closeComment: >
60+
Please reopen this issue once you add more information and updates here.
61+
If this is not the case and you need some help, feel free to seek help
62+
from our [Gitter](https://gitter.im/TheAlgorithms) or ping one of the
63+
reviewers. Thank you for your contributions!

.github/workflows/build.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: "build"
2+
3+
on:
4+
pull_request:
5+
schedule:
6+
- cron: "0 0 * * *" # Run everyday
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: actions/setup-python@v2
14+
with:
15+
python-version: "3.8"
16+
- uses: actions/cache@v2
17+
with:
18+
path: ~/.cache/pip
19+
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip setuptools six
23+
python -m pip install pytest-cov -r requirements.txt
24+
- name: Run tests
25+
run: pytest --doctest-modules --ignore=project_euler/ --cov-report=term-missing:skip-covered --cov=. .
26+
- if: ${{ success() }}
27+
run: scripts/build_directory_md.py 2>&1 | tee DIRECTORY.md

.github/workflows/directory_writer.yml

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ jobs:
88
steps:
99
- uses: actions/checkout@v1 # v1, NOT v2
1010
- uses: actions/setup-python@v2
11-
with:
12-
python-version: 3.x
1311
- name: Write DIRECTORY.md
1412
run: |
1513
scripts/build_directory_md.py 2>&1 | tee DIRECTORY.md

.github/workflows/pre-commit.yml

+6
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ jobs:
77
runs-on: ubuntu-latest
88
steps:
99
- uses: actions/checkout@v2
10+
- uses: actions/cache@v2
11+
with:
12+
path: |
13+
~/.cache/pre-commit
14+
~/.cache/pip
15+
key: ${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
1016
- uses: actions/setup-python@v2
1117
- name: Install pre-commit
1218
run: |

.github/workflows/stale.yml

-23
This file was deleted.

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ repos:
4242
hooks:
4343
- id: codespell
4444
args:
45-
- --ignore-words-list=ans,fo,followings,hist,iff,secant,som,tim
45+
- --ignore-words-list=ans,fo,followings,hist,iff,mater,secant,som,tim
4646
- --skip="./.*,./other/dictionary.txt,./other/words,./project_euler/problem_022/p022_names.txt"
4747
- --quiet-level=2
4848
exclude: |

.travis.yml

-17
This file was deleted.

DIRECTORY.md

+32
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
* [Decimal To Hexadecimal](https://github.com/TheAlgorithms/Python/blob/master/conversions/decimal_to_hexadecimal.py)
101101
* [Decimal To Octal](https://github.com/TheAlgorithms/Python/blob/master/conversions/decimal_to_octal.py)
102102
* [Hexadecimal To Decimal](https://github.com/TheAlgorithms/Python/blob/master/conversions/hexadecimal_to_decimal.py)
103+
* [Molecular Chemistry](https://github.com/TheAlgorithms/Python/blob/master/conversions/molecular_chemistry.py)
103104
* [Prefix Conversions](https://github.com/TheAlgorithms/Python/blob/master/conversions/prefix_conversions.py)
104105
* [Roman To Integer](https://github.com/TheAlgorithms/Python/blob/master/conversions/roman_to_integer.py)
105106
* [Temperature Conversions](https://github.com/TheAlgorithms/Python/blob/master/conversions/temperature_conversions.py)
@@ -205,8 +206,10 @@
205206
* [Heaps Algorithm](https://github.com/TheAlgorithms/Python/blob/master/divide_and_conquer/heaps_algorithm.py)
206207
* [Heaps Algorithm Iterative](https://github.com/TheAlgorithms/Python/blob/master/divide_and_conquer/heaps_algorithm_iterative.py)
207208
* [Inversions](https://github.com/TheAlgorithms/Python/blob/master/divide_and_conquer/inversions.py)
209+
* [Kth Order Statistic](https://github.com/TheAlgorithms/Python/blob/master/divide_and_conquer/kth_order_statistic.py)
208210
* [Max Subarray Sum](https://github.com/TheAlgorithms/Python/blob/master/divide_and_conquer/max_subarray_sum.py)
209211
* [Mergesort](https://github.com/TheAlgorithms/Python/blob/master/divide_and_conquer/mergesort.py)
212+
* [Peak](https://github.com/TheAlgorithms/Python/blob/master/divide_and_conquer/peak.py)
210213
* [Power](https://github.com/TheAlgorithms/Python/blob/master/divide_and_conquer/power.py)
211214
* [Strassen Matrix Multiplication](https://github.com/TheAlgorithms/Python/blob/master/divide_and_conquer/strassen_matrix_multiplication.py)
212215

@@ -361,6 +364,7 @@
361364
* [Random Forest Regressor](https://github.com/TheAlgorithms/Python/blob/master/machine_learning/random_forest_regressor.py)
362365
* [Scoring Functions](https://github.com/TheAlgorithms/Python/blob/master/machine_learning/scoring_functions.py)
363366
* [Sequential Minimum Optimization](https://github.com/TheAlgorithms/Python/blob/master/machine_learning/sequential_minimum_optimization.py)
367+
* [Similarity Search](https://github.com/TheAlgorithms/Python/blob/master/machine_learning/similarity_search.py)
364368
* [Support Vector Machines](https://github.com/TheAlgorithms/Python/blob/master/machine_learning/support_vector_machines.py)
365369
* [Word Frequency Functions](https://github.com/TheAlgorithms/Python/blob/master/machine_learning/word_frequency_functions.py)
366370

@@ -389,6 +393,7 @@
389393
* [Chudnovsky Algorithm](https://github.com/TheAlgorithms/Python/blob/master/maths/chudnovsky_algorithm.py)
390394
* [Collatz Sequence](https://github.com/TheAlgorithms/Python/blob/master/maths/collatz_sequence.py)
391395
* [Combinations](https://github.com/TheAlgorithms/Python/blob/master/maths/combinations.py)
396+
* [Decimal Isolate](https://github.com/TheAlgorithms/Python/blob/master/maths/decimal_isolate.py)
392397
* [Entropy](https://github.com/TheAlgorithms/Python/blob/master/maths/entropy.py)
393398
* [Eulers Totient](https://github.com/TheAlgorithms/Python/blob/master/maths/eulers_totient.py)
394399
* [Explicit Euler](https://github.com/TheAlgorithms/Python/blob/master/maths/explicit_euler.py)
@@ -452,6 +457,7 @@
452457
* [Harmonic Series](https://github.com/TheAlgorithms/Python/blob/master/maths/series/harmonic_series.py)
453458
* [P Series](https://github.com/TheAlgorithms/Python/blob/master/maths/series/p_series.py)
454459
* [Sieve Of Eratosthenes](https://github.com/TheAlgorithms/Python/blob/master/maths/sieve_of_eratosthenes.py)
460+
* [Sigmoid](https://github.com/TheAlgorithms/Python/blob/master/maths/sigmoid.py)
455461
* [Simpson Rule](https://github.com/TheAlgorithms/Python/blob/master/maths/simpson_rule.py)
456462
* [Softmax](https://github.com/TheAlgorithms/Python/blob/master/maths/softmax.py)
457463
* [Square Root](https://github.com/TheAlgorithms/Python/blob/master/maths/square_root.py)
@@ -492,6 +498,7 @@
492498
* [Autocomplete Using Trie](https://github.com/TheAlgorithms/Python/blob/master/other/autocomplete_using_trie.py)
493499
* [Binary Exponentiation](https://github.com/TheAlgorithms/Python/blob/master/other/binary_exponentiation.py)
494500
* [Binary Exponentiation 2](https://github.com/TheAlgorithms/Python/blob/master/other/binary_exponentiation_2.py)
501+
* [Davis–Putnam–Logemann–Loveland](https://github.com/TheAlgorithms/Python/blob/master/other/davis–putnam–logemann–loveland.py)
495502
* [Detecting English Programmatically](https://github.com/TheAlgorithms/Python/blob/master/other/detecting_english_programmatically.py)
496503
* [Dijkstra Bankers Algorithm](https://github.com/TheAlgorithms/Python/blob/master/other/dijkstra_bankers_algorithm.py)
497504
* [Doomsday](https://github.com/TheAlgorithms/Python/blob/master/other/doomsday.py)
@@ -520,6 +527,7 @@
520527
* [Sierpinski Triangle](https://github.com/TheAlgorithms/Python/blob/master/other/sierpinski_triangle.py)
521528
* [Tower Of Hanoi](https://github.com/TheAlgorithms/Python/blob/master/other/tower_of_hanoi.py)
522529
* [Triplet Sum](https://github.com/TheAlgorithms/Python/blob/master/other/triplet_sum.py)
530+
* [Two Pointer](https://github.com/TheAlgorithms/Python/blob/master/other/two_pointer.py)
523531
* [Two Sum](https://github.com/TheAlgorithms/Python/blob/master/other/two_sum.py)
524532
* [Word Patterns](https://github.com/TheAlgorithms/Python/blob/master/other/word_patterns.py)
525533

@@ -659,6 +667,8 @@
659667
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_048/sol1.py)
660668
* Problem 049
661669
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_049/sol1.py)
670+
* Problem 050
671+
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_050/sol1.py)
662672
* Problem 051
663673
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_051/sol1.py)
664674
* Problem 052
@@ -674,23 +684,30 @@
674684
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_056/sol1.py)
675685
* Problem 057
676686
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_057/sol1.py)
687+
* Problem 058
688+
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_058/sol1.py)
677689
* Problem 062
678690
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_062/sol1.py)
679691
* Problem 063
680692
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_063/sol1.py)
693+
* Problem 064
694+
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_064/sol1.py)
681695
* Problem 065
682696
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_065/sol1.py)
683697
* Problem 067
684698
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_067/sol1.py)
685699
* Problem 069
686700
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_069/sol1.py)
701+
* Problem 070
702+
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_070/sol1.py)
687703
* Problem 071
688704
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_071/sol1.py)
689705
* Problem 072
690706
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_072/sol1.py)
691707
* [Sol2](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_072/sol2.py)
692708
* Problem 074
693709
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_074/sol1.py)
710+
* [Sol2](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_074/sol2.py)
694711
* Problem 075
695712
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_075/sol1.py)
696713
* Problem 076
@@ -699,6 +716,8 @@
699716
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_080/sol1.py)
700717
* Problem 081
701718
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_081/sol1.py)
719+
* Problem 087
720+
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_087/sol1.py)
702721
* Problem 091
703722
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_091/sol1.py)
704723
* Problem 097
@@ -713,6 +732,8 @@
713732
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_119/sol1.py)
714733
* Problem 120
715734
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_120/sol1.py)
735+
* Problem 123
736+
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_123/sol1.py)
716737
* Problem 125
717738
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_125/sol1.py)
718739
* Problem 173
@@ -721,8 +742,16 @@
721742
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_174/sol1.py)
722743
* Problem 191
723744
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_191/sol1.py)
745+
* Problem 203
746+
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_203/sol1.py)
747+
* Problem 206
748+
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_206/sol1.py)
749+
* Problem 207
750+
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_207/sol1.py)
724751
* Problem 234
725752
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_234/sol1.py)
753+
* Problem 301
754+
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_301/sol1.py)
726755
* Problem 551
727756
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_551/sol1.py)
728757

@@ -731,6 +760,7 @@
731760
* [Half Adder](https://github.com/TheAlgorithms/Python/blob/master/quantum/half_adder.py)
732761
* [Not Gate](https://github.com/TheAlgorithms/Python/blob/master/quantum/not_gate.py)
733762
* [Quantum Entanglement](https://github.com/TheAlgorithms/Python/blob/master/quantum/quantum_entanglement.py)
763+
* [Ripple Adder Classic](https://github.com/TheAlgorithms/Python/blob/master/quantum/ripple_adder_classic.py)
734764
* [Single Qubit Measure](https://github.com/TheAlgorithms/Python/blob/master/quantum/single_qubit_measure.py)
735765

736766
## Scheduling
@@ -815,6 +845,7 @@
815845
* [Prefix Function](https://github.com/TheAlgorithms/Python/blob/master/strings/prefix_function.py)
816846
* [Rabin Karp](https://github.com/TheAlgorithms/Python/blob/master/strings/rabin_karp.py)
817847
* [Remove Duplicate](https://github.com/TheAlgorithms/Python/blob/master/strings/remove_duplicate.py)
848+
* [Reverse Letters](https://github.com/TheAlgorithms/Python/blob/master/strings/reverse_letters.py)
818849
* [Reverse Words](https://github.com/TheAlgorithms/Python/blob/master/strings/reverse_words.py)
819850
* [Split](https://github.com/TheAlgorithms/Python/blob/master/strings/split.py)
820851
* [Swap Case](https://github.com/TheAlgorithms/Python/blob/master/strings/swap_case.py)
@@ -829,6 +860,7 @@
829860
* [Co2 Emission](https://github.com/TheAlgorithms/Python/blob/master/web_programming/co2_emission.py)
830861
* [Covid Stats Via Xpath](https://github.com/TheAlgorithms/Python/blob/master/web_programming/covid_stats_via_xpath.py)
831862
* [Crawl Google Results](https://github.com/TheAlgorithms/Python/blob/master/web_programming/crawl_google_results.py)
863+
* [Crawl Google Scholar Citation](https://github.com/TheAlgorithms/Python/blob/master/web_programming/crawl_google_scholar_citation.py)
832864
* [Current Stock Price](https://github.com/TheAlgorithms/Python/blob/master/web_programming/current_stock_price.py)
833865
* [Current Weather](https://github.com/TheAlgorithms/Python/blob/master/web_programming/current_weather.py)
834866
* [Daily Horoscope](https://github.com/TheAlgorithms/Python/blob/master/web_programming/daily_horoscope.py)

0 commit comments

Comments
 (0)