Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetching last changes #1

Merged
merged 832 commits into from
May 18, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
832 commits
Select commit Hold shift + click to select a range
1da1ab0
Improve doctest and comment for maximum sub-array problem (#1503)
poyea Oct 28, 2019
3ada8bb
Page replacement algorithm, LRU (#871)
phileasme Oct 28, 2019
f8a30b4
Addition of Secant Method (#876)
dimgrichr Oct 28, 2019
4f86f58
Create GAN.py (#1445)
DevilLord9967 Oct 28, 2019
e463c0b
Update dictionary.txt (#1507)
Kumar-Nishchay Oct 29, 2019
e3d4d2b
Update greatest_common_divisor.py (#1513)
percy07 Oct 29, 2019
1ed47ad
Update palindrome.py (#1509)
percy07 Oct 29, 2019
dfea6f3
:white_check_mark: added tests for Perceptron in Neural Networks (#1506)
janithwanni Oct 29, 2019
bfac867
Add doctests to other/word_patterns.py (#1518)
cclauss Oct 29, 2019
4880e54
Create prime_numbers.py (#1519)
5ur3 Oct 29, 2019
f8e97aa
Update basic_maths.py (#1517)
percy07 Oct 29, 2019
53ff735
Factors of a number (#1493)
himanshujaindev Oct 29, 2019
6343361
average_mode.py (#1491)
LokiUvaraj Oct 29, 2019
fc533a7
Simplified DES (#1382)
srisumapasumarthi Oct 30, 2019
df95f43
Update quick_select.py (#1523)
percy07 Oct 30, 2019
357dbd4
Doctest, type hints and bug in LIS_O(nlogn) (#1525)
poyea Oct 30, 2019
8a5633a
Euler Problem 27 solution script Added (#1466)
RitwickGhosh Oct 31, 2019
6d44cdd
perfect square (#1534)
realDuYuanChao Oct 31, 2019
80e1c87
Added Problem 33 (#1440)
pingings Oct 31, 2019
814750e
update factorial (#1535)
realDuYuanChao Oct 31, 2019
c717f8d
add max sum contigous subsequence (#1537)
taufikalgi Oct 31, 2019
62e51fe
recursive quick sort (#1536)
metehaansever Oct 31, 2019
7bc0462
Non-recursive Segment Tree implementation (#1543)
qf-jonathan Nov 1, 2019
8107548
Travis CI: Write & print DIRECTORY.md on one line (#1542)
mrvnmchm Nov 1, 2019
0e3357a
added solution 1 for problem_99 in project_euler (#1545)
itsvinayak Nov 1, 2019
8c443cc
add floor() (#1551)
realDuYuanChao Nov 4, 2019
5452e94
Porta cipher (#1550)
mrvnmchm Nov 4, 2019
a9d5378
Doctest and typing for longest_increasing_subsequence.py (#1526)
poyea Nov 4, 2019
ad2db80
Add sol3 for project_euler problem_03 (#1553)
jwmneu Nov 7, 2019
db515e5
added rsa_factorization.py (#1556)
Jiang-zzz Nov 9, 2019
4c37eb7
Improved on Singly Linked List Programs (#1558)
hanif-ali Nov 10, 2019
82a11d7
Fix bug in bellman_ford.py (#1544)
JakobMusik Nov 10, 2019
5ac4391
Python Program that fetches top trending news (#1559)
SKAUL05 Nov 12, 2019
b7e37a8
Added a new Python script and some changes in existing one (#1560)
SKAUL05 Nov 12, 2019
fa6331a
Moved to TheAlgorithms/Jupyter (#1563)
cclauss Nov 14, 2019
dd7d2fa
Panagram Script Added (#1564)
Nov 14, 2019
52cf668
add sol3 to project_euler/problem_08 (#1557)
jwmneu Nov 14, 2019
5df8aec
GitHub Action formats our code with psf/black (#1569)
cclauss Nov 14, 2019
ea9bf0a
directory_writer (#1) (#1549)
mrvnmchm Nov 14, 2019
e3aa0f6
fix implementation errors. (#1568)
Jiang-zzz Nov 14, 2019
e3f55ae
Remove Duplicate Script Added (#1570)
Nov 14, 2019
a7424cc
changed implementation of GitHub action to auto update DIRECTORY.md (…
chttrjeankr Nov 14, 2019
dbaedd4
|| true (#1572)
cclauss Nov 15, 2019
b838f10
Fix indentation contains tabs (flake8 E101,W191) (#1573)
cclauss Nov 16, 2019
9a894eb
Word Occurence Script Added (#1576)
Nov 17, 2019
5616fa9
Add pytest-cov (#1578)
sirex Nov 17, 2019
12f69a8
Remove code with side effects from main (#1577)
sirex Nov 17, 2019
0832e1e
Adding circular_queue.py (#1574)
Himan10 Nov 17, 2019
2565797
Reverse Words (#1581)
Nov 18, 2019
c57c4ca
Adds operations for circular linked list (#1584)
onlinejudge95 Nov 19, 2019
28c02a1
Improve bellman_ford.py (#1575)
poyea Nov 19, 2019
e8aa812
Update gaussian_filter.py (#1548)
frifich Nov 20, 2019
ec7bc7c
Tabs --> spaces in quine_mc_cluskey.py (#1426)
cclauss Nov 21, 2019
c5fd075
Fractional knapsack (#1524)
ptarun Nov 22, 2019
e09bf69
Update README.md (#1588)
BryanChan777 Nov 23, 2019
4c75f86
added current stock price (#1590)
vansh1999 Nov 23, 2019
2ad5a1f
Implemented simple keyword cipher (#1589)
achance6 Nov 23, 2019
0d3c9d5
Update singly_linked_list.py (#1593)
vikasit12 Nov 26, 2019
140b79b
Adding Linear Discriminant Analysis (#1592)
miladsade96 Nov 26, 2019
4baf397
GitHub Action to mark stale issues and pull requests (#1594)
cclauss Nov 27, 2019
f4a7c50
converting generator object to a list object (#1602)
miladsade96 Nov 28, 2019
2fb6f78
Typo in a comment (#1603)
cclauss Nov 28, 2019
5d20dbf
add a generic heap (#906)
SaurabhGoyal Nov 30, 2019
415c9f5
Improve prim.py (#1226)
dunderbruno Dec 1, 2019
4dca957
Pythagoras (#1243)
dunderbruno Dec 1, 2019
74aeaa3
Code for Eulers Totient function (#1229)
Abhijitpatil19 Dec 1, 2019
8ffc4f8
fixed bug (#1610)
GeorgeChara Dec 3, 2019
caad744
Added Multilayer Perceptron (sklearn) (#1609)
QuantumNovice Dec 3, 2019
494fb4f
address merge_soft duplicate files (#1612)
bardia52 Dec 5, 2019
3cfca42
add the index calculation class at digital_image_processing and the h…
johnnv1 Dec 6, 2019
ccc1ff2
pigeonhole sorting in python (#364)
SHAKTISINGH2323 Dec 6, 2019
938dd0b
improved prime numbers implementation (#1606)
nikolasvargas Dec 7, 2019
9eb50cc
Improved readability (#1615)
GeorgeChara Dec 7, 2019
26b0803
Simplify sudoku.is_completed() using builtin all() (#1608)
cclauss Dec 8, 2019
43905ef
Adding doctests into LDA algorithm (#1621)
miladsade96 Dec 8, 2019
74d96ab
Fixed issue #1368 (#1482)
LawJarp-A Dec 8, 2019
02b717e
Update odd_even_transposition_parallel.py (#1458)
samarthsehgal97 Dec 8, 2019
9316618
digital_image_processing/convert_to_negative (#1216)
msk4862 Dec 9, 2019
1cbeaa2
Image processing algorithms added (#616)
binish784 Dec 10, 2019
b9bff8f
Remove \r from strings (#1622)
cclauss Dec 10, 2019
d385472
Update find_min.py (#1627)
heartsmoking Dec 11, 2019
bc5b92f
Harmonic Geometric and P-Series Added (#1633)
MeIbtihajnaeem Dec 14, 2019
f4779bc
Bug Fixed in newton_raphson_method.py (#1634)
rohitjoshi21 Dec 15, 2019
1af4c02
adding doctests on coin_change.py and fixed some typos (#1337)
Iqrar99 Dec 18, 2019
86dbf0a
file iterating_through_submasks.py for given mask is added in dynamic…
faizan2700 Dec 18, 2019
5f57ac9
Add docstr and algorithm to BFS shortest path module (#1637)
kylepw Dec 19, 2019
c67776d
other/integeration_by_simpson_approx.py is added for approximate inte…
faizan2700 Dec 20, 2019
1d9266e
Fixed warning string for Key B = 0 (#1639)
saranshgupta1995 Dec 20, 2019
3242682
Create roman_to_integer.py (#1636)
jasper256 Dec 20, 2019
81ae5ad
Update binary_search_tree.py (#1339)
Hocnonsense Dec 21, 2019
aa18600
Stack using double linked list (#1413)
Dhakad9 Dec 21, 2019
725834b
Added binary exponentiaion with respect to modulo (#1428)
Anzoteh96 Dec 24, 2019
1b39858
Update back_propagation_neural_network.py (#1342)
y4shb Dec 26, 2019
34c808b
actions/checkout@v2 (#1643)
cclauss Dec 26, 2019
28419cf
pyupgrade --py37-plus **/*.py (#1654)
cclauss Jan 3, 2020
1d606d8
Dijkstra's Bankers algorithm (#1650)
cclauss Jan 3, 2020
d4fc55c
Add files via upload (#1657)
hkp27299 Jan 4, 2020
1cc817b
update volumes with type hints + some refactoring (#1353)
yuriimchg Jan 5, 2020
b212a59
Create deque_doubly.py (#1652)
Himan10 Jan 5, 2020
51b7690
Create get_imdb_top_250_movies_csv.py (#1659)
nishithshowri006 Jan 5, 2020
46df735
New Code!!(Finding the N Possible Binary Search Tree and Binary Tree …
MadyDixit Jan 7, 2020
cbab5f1
added hill climbing algorithm (#1666)
Faraz126 Jan 8, 2020
36d229f
number of Possible Binary Search Tree and Binary Tree. (#1670)
MadyDixit Jan 8, 2020
1f2b1a8
Typos in comments in hill_climbing.py (#1667)
cclauss Jan 8, 2020
e849578
Update and rename lca.py to lowest_common_ancestor.py (#1664)
cclauss Jan 8, 2020
a26ae00
Added to maths and strings (#1642)
coleman2246 Jan 8, 2020
f9e1a16
git add DIRECTORY.md (#1674)
cclauss Jan 10, 2020
9873361
Added Strassen divide and conquer algorithm to multiply matrices. (#1…
AlexLeka98 Jan 12, 2020
2cb6a65
Corrects failing check in master (#1676)
onlinejudge95 Jan 12, 2020
4607cd4
Add a program to evaluate a string in prefix notation (Polish Notatio…
M0r13n Jan 12, 2020
75523f9
A recursive insertion sort (#1683)
shrabian Jan 13, 2020
b492e64
Create pull_request_template.md (#1684)
cclauss Jan 13, 2020
56e7ae0
enhance swapping code in link (#1660)
lanzhiwang Jan 14, 2020
d09a805
Typo? (#1653)
LoganLieou Jan 14, 2020
fc4c0f5
implement max heap and more pythonic (#1685)
lanzhiwang Jan 14, 2020
38bad6b
Implemented Square Root Algorithm (#1687)
coleman2246 Jan 15, 2020
c5b376d
Solution for problem 30 of Euler Project (#1690)
deadshotsb Jan 16, 2020
c01d178
Added implementation for simulated annealing (#1679)
Faraz126 Jan 17, 2020
bfcb95b
Create codespell.yml (#1698)
cclauss Jan 18, 2020
99ebd1a
Create factorial_iterative.py (#1693)
pooja-git11 Jan 18, 2020
e25d424
Added an algorithm that approximates line lengths (#1692)
shrabian Jan 18, 2020
3042702
Area Under a Curve Algorithm (#1701)
shrabian Jan 19, 2020
724b7d2
Add Prim's algorithm with min heap (#1704)
kylepw Jan 21, 2020
9a8e7de
Adding Armstrong number (#1708)
kostogls Jan 22, 2020
2cf7e8f
fix comment (#1710)
kostogls Jan 22, 2020
46ac50a
codespell --quiet-level=2 (#1711)
cclauss Jan 23, 2020
63a1c41
Added implementation for Bezier Curve, under a new graphics directory…
Faraz126 Jan 25, 2020
5c7d778
Mandates referencing issue in PR (#1717)
onlinejudge95 Jan 27, 2020
bef74d0
Fix typo (#1718)
cclauss Jan 27, 2020
81f077a
Augment binary search algorithms (#1719)
cschuerc Jan 28, 2020
74a7b5f
relevant documentation added (#1725)
tania-cmyk Feb 3, 2020
dacf1d0
Implement Manacher's algorithm (#1721)
faizan2700 Feb 5, 2020
e7041a8
Added first come first served scheduling (#1722)
Ale3androsS Feb 6, 2020
1608d75
Improve collatz_sequence algorithm (#1726)
TheSuperNoob Feb 6, 2020
f52b97f
Added Random Forest Regressor and tested with flake8 (#1733)
Miggelito Feb 7, 2020
670f952
Travis CI: Don’t allow bare exceptions (#1734)
cclauss Feb 7, 2020
32ceec5
Added a Monte Carlo simulation (#1723)
MatteoRaso Feb 8, 2020
80718bd
Fixes black failures (#1742)
onlinejudge95 Feb 10, 2020
6fdd53c
Fixes LGTM issues (#1745)
onlinejudge95 Feb 10, 2020
abd3200
Add gitpod config (#1744)
ayoub-edh Feb 10, 2020
1096aa2
Added DP Solution for Optimal BST Problem (#1740)
Feb 11, 2020
fde31c9
Added Bisection algorithm (#1739)
billpaps Feb 11, 2020
7b7c1a0
Fixes unused variable errors in LGTM (#1746)
onlinejudge95 Feb 11, 2020
f0dfc4f
Add Chudnovskys algorithm for calculating many digits of pi (#1752)
TheSuperNoob Feb 12, 2020
4866b13
Fixes black failures from Previous PR (#1751)
onlinejudge95 Feb 12, 2020
53042f0
Create RayleighQuotient.py (#1749)
QuantumNovice Feb 14, 2020
2e405f3
Created geodesy section with one algorithm (#1757)
eightysixth Feb 16, 2020
748702b
Add Monte Carlo dice simulation algorithm (#1759)
naviji Feb 17, 2020
d2f7982
Update quadratic equations solver (#1764)
TheSuperNoob Feb 19, 2020
6b3bbc7
Added doctests in modular_exponential.py (#1775)
Iqrar99 Feb 20, 2020
cb47956
Implemented geodesy - Lambert's ellipsoidal distance (#1763)
eightysixth Feb 20, 2020
59bf115
uses: actions/checkout@v2 (#1779)
cclauss Feb 21, 2020
6d7cbda
add example to estimate area under line using montecarlo (#1782)
singlav Feb 22, 2020
b36e46b
extend estimation of area under curve of y=x using monte carlo simula…
singlav Feb 22, 2020
652b891
Travis CI: Upgrade to Python 3.8 (#1783)
cclauss Feb 23, 2020
5543d14
estimate area under a curve defined by non-negative real-valued conti…
singlav Feb 23, 2020
c1a4cc9
Add bilateral filter (#1786)
praveennadiminti Feb 26, 2020
2b19e84
Create emails_from_url.py (#1756)
lablnet Feb 26, 2020
7f04e5c
contribution guidelines checks (#1787)
matkosoric Mar 4, 2020
a9f73e3
Added SkipList (#1781)
cclauss Mar 5, 2020
182e304
update rot13.py (#1790)
aakashdinkar Mar 8, 2020
5e3eb12
add relu function (#1795)
inoue0426 Mar 13, 2020
10fc90c
Added Random Forest Classifier (#1738)
Miggelito Mar 13, 2020
b1377f0
autoblack: actions/checkout@v1 # Use v1, NOT v2 (#1796)
cclauss Mar 13, 2020
cb5f8c6
Fix typo (#1797)
ehdgua01 Mar 13, 2020
2da98db
Effective directory writer (#1800)
poyea Mar 14, 2020
d547d03
directory_writer: actions/checkout@v1 # Use v1, NOT v2 (#1799)
cclauss Mar 14, 2020
1bc84e1
Add Monte Carlo estimation of PI (#1712)
cschuerc Mar 14, 2020
ab3400b
Travis CI: Fix Travis linter errors (#1802)
cclauss Mar 14, 2020
45524dd
Fix rehashing function will not call insert_data function (#1803)
ehdgua01 Mar 16, 2020
ac664df
'allocation_content_length' (#1808)
wind-Lv Mar 20, 2020
96df906
All suggeted changes within additional time limit tests (#1815)
itsvaibhav01 Mar 27, 2020
f17e982
psf/black changes to next_greater_element.py (#1817)
cclauss Mar 28, 2020
9b376a5
Typo in comment rabin_karp.py (#1820)
emirot Mar 29, 2020
20c2db0
Update reverse_words.py (#1825)
farnswj1 Apr 4, 2020
6043a44
Update basic_binary_tree.py (#1833)
Prince326 Apr 6, 2020
f35484b
Update greedy.py (#1832)
Prince326 Apr 6, 2020
3d129a4
Create Python/quantum/README.md (#1834)
cclauss Apr 7, 2020
e5f7fbc
Change gitpod configuration for python3. (#1827)
brl0 Apr 7, 2020
c1a57e0
Fix typo "panagram" -> "pangram" (#1836)
joaquincabezas Apr 7, 2020
a38e143
Binary search tree using recursion (#1839)
JoanMartin Apr 7, 2020
1b65309
Update README.md (#1842)
Apr 7, 2020
8f2c993
CONTRIBUTING.md: Fix comments about the black formatter (#1841)
cclauss Apr 8, 2020
4103c9f
Update FUNDING.yml (#1829)
cclauss Apr 10, 2020
728deea
Update FUNDING.yml
AnupKumarPanwar Apr 10, 2020
c775baf
Added new Algorithm to find middle element of Linked List (#1822)
meSajied Apr 12, 2020
8bf380c
README.md: sumab() --> sum_ab() for consistancy (#1855)
cclauss Apr 12, 2020
3735e74
added add algorithm (#1856)
Shrutikabansal Apr 12, 2020
7ebe2b9
Test the exception conditions (#1853)
cclauss Apr 13, 2020
7ffdef2
Fix some typos in random forest classifier (#1858)
Prince326 Apr 13, 2020
2fc3f2e
Update year in LICENSE.md (#1848)
markaster Apr 13, 2020
f6ee518
Rename math/add.py to maths/add.py (#1857)
cclauss Apr 13, 2020
d2e8e62
Update g_topological_sort.py (#1873)
SandersLin Apr 16, 2020
b64c4af
Create gaussian_naive_bayes.py (#1861)
Prince326 Apr 17, 2020
d48661e
CONTRIBUTING.md: What is an Algorithm? (#1885)
cclauss Apr 17, 2020
8c01da2
Update random_forest_regressor.py (#1880)
Prince326 Apr 17, 2020
0feed0b
Update CONTRIBUTING.md (#1886)
SandersLin Apr 17, 2020
1c9d4a3
Update abbreviation.py (#1887)
SandersLin Apr 17, 2020
7aaf79c
Initialize set with source in DFS (#1872)
SandersLin Apr 17, 2020
c92a520
Update breadth_first_search.py (#1869)
SandersLin Apr 19, 2020
4b78c69
Create is_palindrome.py (#1754)
lablnet Apr 19, 2020
24b2aec
Create Python/bit_manipulation/README.md (#1897)
cclauss Apr 20, 2020
098be35
fix: space count in strings/word_occurrence.py (#1896)
darkmatter18 Apr 21, 2020
b560b76
Add cellular_automata directory (#1902)
cclauss Apr 23, 2020
58271c5
Update linear_search.py (#1906)
Prince326 Apr 24, 2020
e5dd2b1
Fix typo in Project Euler sol1.py (#1875)
SandersLin Apr 25, 2020
5933cd4
Added sepia tone (#1877)
l3str4nge Apr 26, 2020
0ef9dd3
Create one_dimensional.py (#1905)
8Dion8 Apr 27, 2020
8cb957f
Blacken one_dimensional.py (#1911)
cclauss Apr 27, 2020
fbc038d
Added A1Z26 Cipher (#1914)
LethargicLeprechaun Apr 29, 2020
3d0680e
Added Burkes dithering algorithm. (#1916)
l3str4nge Apr 30, 2020
1ad78b2
Fix invalid escape sequence in binary_search_tree.py (#1920)
cclauss Apr 30, 2020
b01e5b7
Graph coloring (#1921)
CSenshi Apr 30, 2020
308505f
Add shortest path by BFS (#1870)
SandersLin May 1, 2020
bcaa88b
Changed the deprecated `np.matrix` to `np.ndarray` (#1923)
QuantumNovice May 1, 2020
6acd7fb
Wrap lines that go beyond GitHub Editor (#1925)
cclauss May 1, 2020
d62cc35
Update stale comment (#1924)
lkdmttg7 May 2, 2020
a859934
Hamiltonian Cycle (#1930)
CSenshi May 2, 2020
9bb57fb
support_vector_machines.py increase error tolerance to suppress conve…
QuantumNovice May 2, 2020
853741e
enhanced segment tree implementation and more pythonic (#1715)
lanzhiwang May 2, 2020
b6fcee3
Check if a item exist in stack or not (#1931)
May 3, 2020
f80ffe1
added method for checking armstrong number (#1936)
May 3, 2020
9b2d65b
Solution for Euler Problem 26 (#1939)
shuklalok May 3, 2020
d1b2576
Fix psf/black issues than fail the build (#1935)
cclauss May 3, 2020
540023e
Delete FUNDING.yml
AnupKumarPanwar May 4, 2020
1e84aab
Create sol2.py (#1876)
SandersLin May 5, 2020
08c8bb5
Deal with maps (#1945)
cclauss May 6, 2020
3d4ccc3
change method name from front to get_front (#1943)
scriptdruid May 6, 2020
4acc28b
Added new algorithm: cracking caesar cipher with the chi-squared test…
mrmaxguns May 6, 2020
8a8527f
Added Lstm example for stock predection (#1908)
jeffin07 May 7, 2020
a52dd66
Added Shortest Job First Algorithm (#1957)
pharshil1902 May 7, 2020
9e5f365
Add sleep-sort (#1867)
ArvindAROO May 7, 2020
7469fb6
Add graphs/frequent_pattern_graph_miner.py (#1866)
siva1098 May 7, 2020
c18c677
Added Nearest neighbour algorithm (#1934)
l3str4nge May 7, 2020
369562a
Upgrades to caesar_cipher.py (#1958)
mrmaxguns May 8, 2020
8b55a14
Travis CI: lint for useless backslashes (#1961)
cclauss May 9, 2020
eef6393
Kadanes_algorithm (#1959)
Raj-Parekh24 May 9, 2020
77c3e5b
Added A* algorithm (#1913)
jeffin07 May 9, 2020
3d9bb05
Travis CI: Strict flake8 (#1962)
cclauss May 10, 2020
a7cd633
Fix astar (#1966)
cclauss May 10, 2020
1151d8b
Add type hints to max_heap.py (#1960)
halilylm May 11, 2020
ba8b156
Iterative merge sort implementation (#1972)
amangupta0709 May 11, 2020
69171a9
The new version of flake8 is linting f-strings (#1976)
cclauss May 13, 2020
48bb14d
Update linear_search.py (#1974)
Himanshu-77 May 14, 2020
c8fbdee
improved prime number generator to check only up to sqrt(n) instead o…
steven7214 May 14, 2020
a29a2a3
Added file aliquot_sum.py (#1985)
ken437 May 15, 2020
565060a
actions/setup-python@v2 (#1986)
cclauss May 16, 2020
bc8e8f0
Added strand sort (#1982)
l3str4nge May 17, 2020
aa120ce
Add tests and type hints to hill cipher (#1991)
bharath-kotha May 18, 2020
38d2e98
hill_cipher.py: gcd() -> greatest_common_divisor() (#1997)
cclauss May 18, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Solution for Euler Problem 26 (TheAlgorithms#1939)
* Solution for Euler Problem 26

* Update project_euler/problem_26/sol1.py

typo error fix.

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update project_euler/problem_26/sol1.py

typo error fix

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update project_euler/problem_26/sol1.py

ok to remove, this comes from Pycharm automatically when docstring is added.

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update project_euler/problem_26/sol1.py

ok to remove.

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update project_euler/problem_26/sol1.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update project_euler/problem_26/sol1.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update project_euler/problem_26/sol1.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* now_divide = now_divide * 10 % divide_by_number

Co-authored-by: Christian Clauss <cclauss@me.com>
  • Loading branch information
shuklalok and cclauss committed May 3, 2020
commit 9b2d65bac18e3a633e377dcc211fc4c127c6643f
Empty file.
41 changes: 41 additions & 0 deletions project_euler/problem_26/sol1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
"""
Euler Problem 26
https://projecteuler.net/problem=26
Find the value of d < 1000 for which 1/d contains the longest recurring cycle
in its decimal fraction part.
"""

def find_digit(numerator: int, digit: int) -> int:
"""
Considering any range can be provided,
because as per the problem, the digit d < 1000
>>> find_digit(1, 10)
7
>>> find_digit(10, 100)
97
>>> find_digit(10, 1000)
983
"""
the_digit = 1
longest_list_length = 0

for divide_by_number in range(numerator, digit + 1):
has_been_divided = []
now_divide = numerator
for division_cycle in range(1, digit + 1):
if now_divide in has_been_divided:
if longest_list_length < len(has_been_divided):
longest_list_length = len(has_been_divided)
the_digit = divide_by_number
else:
has_been_divided.append(now_divide)
now_divide = now_divide * 10 % divide_by_number

return the_digit


# Tests
if __name__ == "__main__":
import doctest

doctest.testmod()