Skip to content

revert 22 patch #368

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

Closed
wants to merge 173 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
173 commits
Select commit Hold shift + click to select a range
bfd52df
Merge pull request #231 from TheAlgorithms/revert-22-patch-1
harshildarji Jan 20, 2018
b3873be
noqa to silence flake8 on Python 3 only syntax
Jan 20, 2018
cc5102a
noqa to silence flake8 on Python 3 only syntax
Jan 20, 2018
3f6760e
noqa: F821 This syntax is Python 3 only
Jan 20, 2018
54f6d1f
Merge pull request #241 from cclauss/patch-1
harshildarji Jan 21, 2018
4ee0e62
Modernize Python 2 code to get ready for Python 3 AGAIN
Jan 21, 2018
d043448
Fix unresolved name: insert_tail()
Jan 21, 2018
a88ad60
Update singly_LinkedList.py
Jan 21, 2018
1568432
Add files via upload
arcsinecosine Jan 21, 2018
92e0aa2
Add files via upload
arcsinecosine Jan 21, 2018
bc34f6e
Merge pull request #242 from cclauss/modernize-python2-code-again
harshildarji Jan 22, 2018
00c13c2
Merge pull request #243 from cclauss/patch-1
harshildarji Jan 22, 2018
c423419
Merge pull request #244 from arcsinecosine/master
harshildarji Jan 22, 2018
53681f1
Fixed error in binary_search_by_recursion
antfitch Jan 31, 2018
4085de4
Merge pull request #246 from antfitch/antfitch-patch-1
harshildarji Jan 31, 2018
a1c146a
Updated average case for Quicksort
antfitch Jan 31, 2018
1da1e20
Merge pull request #247 from antfitch/antfitch-patch-2
harshildarji Feb 1, 2018
fe6e959
Setting the files in the same folder
mavroudo Feb 11, 2018
a488369
LU decomposition
mavroudo Feb 11, 2018
af3d867
Merge branch 'master' of https://github.com/MindTraper/Python into Mi…
harshildarji Feb 14, 2018
f519ac5
Merge branch 'MindTraper-master'
harshildarji Feb 14, 2018
ce30361
Update Arrays
akshaykumar2505 Feb 15, 2018
14fef95
Merge pull request #250 from akshaykumar123/patch-1
harshildarji Feb 16, 2018
30cf24c
added quadrature trapezoidal rule to Maths
ltdouthit Feb 21, 2018
537909d
added quadrature trapezoidal rule to Maths
ltdouthit Feb 21, 2018
8ef43a7
Merge pull request #251 from ltdouthit/Maths/Numerical_Intergration
harshildarji Feb 21, 2018
698faa9
Added Simpson Rule to Maths
ltdouthit Feb 22, 2018
d0268c2
Merge pull request #1 from ltdouthit/Maths/Numerical_Intergration
ltdouthit Feb 22, 2018
1506ac9
MatrixChainOrder
shivg7706 Feb 26, 2018
e87c4f1
Merge pull request #252 from shivg7706/master
harshildarji Feb 26, 2018
744803a
Adding Problem_08
shivg7706 Feb 27, 2018
5955f98
Merge pull request #253 from shivg7706/master
harshildarji Feb 27, 2018
59c797e
Update Arrays
akshaykumar2505 Mar 1, 2018
4d0e2cc
Merge pull request #255 from ltdouthit/master
harshildarji Mar 2, 2018
b21fc06
Merge pull request #254 from akshaykumar123/patch-2
harshildarji Mar 2, 2018
7a428c1
Update Arrays
harshildarji Mar 2, 2018
bae5762
Rename Arrays to Arrays.py
harshildarji Mar 2, 2018
b6b7784
another sol for problem_20
shivg7706 Mar 3, 2018
7dcbca5
Merge pull request #257 from shivg7706/master
harshildarji Mar 3, 2018
744dd71
Add sorts for python3
pl04351820 Mar 4, 2018
6fa7e44
Merge pull request #259 from pl04351820/master
harshildarji Mar 4, 2018
0b85929
Add files via upload
Mar 4, 2018
f6d7998
Merge pull request #260 from christianbender/added_linearAlgebra
harshildarji Mar 5, 2018
a368d62
Add files via upload
Mar 5, 2018
95a5331
Merge pull request #261 from christianbender/added_linearAlgebra
harshildarji Mar 5, 2018
c975cac
function '__init__' miss a 'i'
williamfzc Mar 7, 2018
fecba12
Merge pull request #262 from williamfzc/master
harshildarji Mar 7, 2018
ab5f262
pl04351820 Mar 8, 2018
2f53847
pl04351820 Mar 8, 2018
e3a03c5
networking_flow
pl04351820 Mar 8, 2018
894af09
Merge pull request #263 from pl04351820/master
harshildarji Mar 9, 2018
601edf3
QuineMcCluskey
shivg7706 Mar 12, 2018
8be9dfc
Merge pull request #264 from shivg7706/master
harshildarji Mar 12, 2018
7beaeae
Brute force solution to Problem 10
daniel-s-ingram Mar 14, 2018
301c907
Dynamic programming solution to Problem 25
daniel-s-ingram Mar 14, 2018
ac14455
Combinatoric solution using Pascal's Triangle to Problem 15
daniel-s-ingram Mar 14, 2018
7704151
Solution to Problem 28
daniel-s-ingram Mar 14, 2018
81dc221
Solution to Problem 28
daniel-s-ingram Mar 14, 2018
e677361
fixed spelling error
AmirNaghibi Mar 15, 2018
ee69c09
Merge pull request #266 from daniel-s-ingram/master
harshildarji Mar 15, 2018
6035672
Merge pull request #267 from AmirNaghibi/spelling-fix
harshildarji Mar 15, 2018
46b4e51
Solution to Problem 48
daniel-s-ingram Mar 18, 2018
689e934
Solution to Problem 17
daniel-s-ingram Mar 18, 2018
2d2644e
Solution to Problem 17
daniel-s-ingram Mar 18, 2018
00a2b90
Fix Python 2 syntax error in matrix_chain_order.py
Mar 19, 2018
705f43a
xrange() was removed in Python 3 in favor of range()
Mar 19, 2018
0516bde
from __future__ import print_function For Python 3
Mar 19, 2018
3615322
from __future__ import print_function for Python 3
Mar 19, 2018
4fd777e
Update SimpsonRule.py
Mar 19, 2018
395fa63
Merge pull request #268 from daniel-s-ingram/master
harshildarji Mar 19, 2018
92484f2
Merge pull request #269 from cclauss/patch-3
harshildarji Mar 19, 2018
5e21232
Merge pull request #270 from cclauss/patch-5
harshildarji Mar 19, 2018
3899f9b
Merge pull request #271 from cclauss/patch-6
harshildarji Mar 19, 2018
c6c5d62
Fixed xrange compatibility for Python 3
daniel-s-ingram Mar 19, 2018
a4cd897
Solution to Problem 11
daniel-s-ingram Mar 19, 2018
7ee262e
Merge branch 'master' into master
daniel-s-ingram Mar 19, 2018
924d0a0
Added xrange compatibility for Python 3
daniel-s-ingram Mar 19, 2018
a872085
Merge branch 'master' of https://github.com/daniel-s-ingram/PythonAlg…
daniel-s-ingram Mar 19, 2018
c461b34
Merge pull request #272 from daniel-s-ingram/master
harshildarji Mar 19, 2018
a753acf
Computes minimum cost for converting one string into another
daniel-s-ingram Mar 20, 2018
6abab54
Minimum cost for transformation from one string to another using basi…
daniel-s-ingram Mar 20, 2018
0deb227
Update min-cost-string-conversion.py
daniel-s-ingram Mar 20, 2018
1fa23f5
hash functions added
Mar 20, 2018
a5f0ae8
Solution to Problem 22
daniel-s-ingram Mar 21, 2018
070ebb3
Merge branch 'master' of https://github.com/daniel-s-ingram/PythonAlg…
daniel-s-ingram Mar 21, 2018
6b60a6b
Merge pull request #273 from daniel-s-ingram/master
harshildarji Mar 21, 2018
fc3bdb6
Merge pull request #274 from gabrielangelo/master
harshildarji Mar 21, 2018
1ead4e0
Added Solution to Problem 2 in a simple approach
girijamanoj Mar 22, 2018
92cbe09
Merge pull request #275 from girijamanojkumarreddy/master
harshildarji Mar 22, 2018
888c51b
Counting integer partitions
daniel-s-ingram Mar 22, 2018
5f1ab6b
Merge pull request #276 from daniel-s-ingram/master
harshildarji Mar 22, 2018
49a3396
Added a Solution using Euclidean Algo
girijamanoj Mar 22, 2018
570c27c
Solution to Problem 21
daniel-s-ingram Mar 22, 2018
68e5bb4
Solution to Problem 76
daniel-s-ingram Mar 22, 2018
f538ea5
Added General solution for Problem 9
girijamanoj Mar 23, 2018
a2e615e
Merge pull request #277 from girijamanojkumarreddy/master
harshildarji Mar 23, 2018
4045f05
Merge pull request #278 from daniel-s-ingram/master
harshildarji Mar 23, 2018
eb40f43
Solution to Problem 53
daniel-s-ingram Mar 25, 2018
9319981
Merge pull request #279 from daniel-s-ingram/master
harshildarji Mar 26, 2018
7b1b33a
Solution to Problem 19
daniel-s-ingram Mar 26, 2018
b4cbf5d
Merge pull request #280 from daniel-s-ingram/master
harshildarji Mar 26, 2018
53d9989
Solution to Problem 12
daniel-s-ingram Mar 28, 2018
cf14473
Merge pull request #281 from daniel-s-ingram/master
Mar 30, 2018
9ed60ba
Solution to Problem 36
daniel-s-ingram Apr 2, 2018
6a8f1cf
Solution to Problem 40
daniel-s-ingram Apr 3, 2018
b172ec3
Solution to Problem 52
daniel-s-ingram Apr 3, 2018
78beda5
Merge pull request #282 from daniel-s-ingram/master
harshildarji Apr 3, 2018
18907e4
fix type error (except an int) in jumpmp_search line 7.
clobob Apr 13, 2018
0a1b6ad
Merge pull request #283 from clobob/master
Apr 13, 2018
3a0555b
Create NewtonRaphsonMethod.py
yesIamHasi Apr 13, 2018
0fdd2d3
Create Onepad_Cipher.py
yesIamHasi Apr 13, 2018
31e1913
Merge pull request #284 from yesIamHasi/patch-1
harshildarji Apr 13, 2018
a2b540f
Merge pull request #285 from yesIamHasi/patch-2
harshildarji Apr 13, 2018
13ebdc3
I fixed the sol3.py of problem 1
Apr 15, 2018
2c0de39
Merge pull request #290 from TheAlgorithms/fixed_sol3_problem1
Apr 15, 2018
10b0a40
fixed solution 4 of problem 1
Apr 15, 2018
ca5c6f2
Merge pull request #292 from TheAlgorithms/fixed_solv_4_problem1
Apr 15, 2018
6211929
basic client-server implementation
harshildarji Apr 16, 2018
3a7e75f
added a option for termination the program
Apr 16, 2018
c1422ec
fixed the assert statments
Apr 16, 2018
060988b
Merge pull request #293 from TheAlgorithms/changed_chaosmachine
Apr 16, 2018
cfae621
I documented the md5 hash
Apr 16, 2018
0494d48
added a docstring
Apr 16, 2018
dbfc220
Merge pull request #294 from TheAlgorithms/documented_md5_hash
Apr 16, 2018
3562182
Update sol2.py
bp274 Apr 16, 2018
5832340
Merge pull request #295 from bp274/master
harshildarji Apr 16, 2018
4b58a88
another sol for 11
shivg7706 Apr 26, 2018
ab9ee40
adding 22 and 24
shivg7706 Apr 26, 2018
515cf2e
changes
shivg7706 Apr 26, 2018
f510207
Merge pull request #296 from shivg7706/master
Apr 29, 2018
09088cd
Create Fischer-Yates_Shuffle.py
yesIamHasi May 19, 2018
35110b6
Tabu Search
irokafetzaki May 19, 2018
2d360cd
Merge pull request #298 from yesIamHasi/patch-5
harshildarji May 20, 2018
099caeb
Merge pull request #300 from irokafetzaki/tabu
harshildarji May 20, 2018
237df47
Create merge_sort_fastest.py
yesIamHasi May 20, 2018
8957cf7
Removed empty lines (255-313)
harshildarji May 21, 2018
7f4b240
Update merge_sort_fastest.py
harshildarji May 21, 2018
71fd719
Update merge_sort_fastest.py
harshildarji May 21, 2018
2e74c8e
Merge pull request #301 from yesIamHasi/patch-6
May 21, 2018
ca7eb46
quicksort_3_partition
May 28, 2018
f1fe458
Updated_caesar_cipher.py
PyDevthon May 28, 2018
1361722
small improvements!
harshildarji May 28, 2018
192ba07
Merge pull request #305 from PyDevthon/patch-1
harshildarji May 28, 2018
31f968f
small change!
harshildarji May 28, 2018
8727246
Merge pull request #304 from hytae1993/master
harshildarji May 28, 2018
16cd42c
Updated sol2.py to make it work as expected
harshildarji Jun 3, 2018
0d19edb
refactor-segment-tree
AnshulMalik Jun 5, 2018
cc51a66
modify README.md by psyas for just test
psyas Jun 12, 2018
602eae7
Elgamal cipher key generator code - (initial)
psyas Jun 12, 2018
0c8707d
Elgamal cipher key generator code - (initial)
psyas Jun 12, 2018
cb6c82c
Merge pull request #318 from psyas/master
harshildarji Jun 13, 2018
9489e85
Break if the collection is sorted
Jun 23, 2018
d4b4b7b
Merge pull request #321 from aldokkani/master
harshildarji Jun 25, 2018
ac30a97
typo: strip
Wayde2014 Jun 26, 2018
d4594da
print() is a function in Python 3
Jul 2, 2018
ee3b0f2
Properly define raw_input)( in Python 3
Jul 2, 2018
bec160c
Use strip() to deal with leading or trailing whitespace
Jul 3, 2018
2ca8d16
Merge pull request #324 from cclauss/patch-3
Jul 16, 2018
ee92291
Merge pull request #325 from cclauss/patch-5
Jul 16, 2018
ae51489
Merge pull request #316 from AnshulMalik/segment-tree-refactor
Jul 22, 2018
9faaebc
Merge pull request #323 from Wayde2014/master
Jul 22, 2018
2f22ea1
Added test case
bharath-123 Jul 22, 2018
d96048a
Updated test case
bharath-123 Jul 22, 2018
a9f9062
Added code for memory function implementation
bharath-123 Jul 22, 2018
6da7bec
Merge pull request #330 from bharath-123/patch-1
Jul 22, 2018
bd7054a
updated testcase
bharath-123 Jul 23, 2018
dc5e42a
Merge branch 'master' into patch-2
bharath-123 Jul 23, 2018
3ea683a
Merge pull request #331 from bharath-123/patch-2
Jul 23, 2018
ce3e678
merge sort average&worst case scenarios changed
hasangokdag Sep 13, 2018
b62a258
renamed `NeutonMethod.py` to `NewtonMethod.py`
ahelm Sep 25, 2018
8051da3
Merge pull request #348 from ahelm/fix/newton_file_name
harshildarji Sep 25, 2018
73ae8f2
merge sort average&worst case scenarios changed (#340)
AnshulMalik Sep 28, 2018
3a77380
Undefined name: import random in Onepad_Cipher.py (#339)
Sep 28, 2018
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
Added xrange compatibility for Python 3
  • Loading branch information
daniel-s-ingram committed Mar 19, 2018
commit 924d0a0552b919f908d2ec4752d9ddb7066a4cb1
11 changes: 8 additions & 3 deletions Project Euler/Problem 11/sol1.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
01 70 54 71 83 51 54 69 16 92 33 48 61 43 52 01 89 19 67 48
'''

try:
xrange #Python 2
except NameError:
xrange = range #Python 2

def largest_product(grid):
nColumns = len(grid[0])
nRows = len(grid)
Expand All @@ -33,8 +38,8 @@ def largest_product(grid):
rlDiagProduct = 0

#Check vertically, horizontally, diagonally at the same time (only works for nxn grid)
for i in range(nColumns):
for j in range(nRows-3):
for i in xrange(nColumns):
for j in xrange(nRows-3):
vertProduct = grid[j][i]*grid[j+1][i]*grid[j+2][i]*grid[j+3][i]
horzProduct = grid[i][j]*grid[i][j+1]*grid[i][j+2]*grid[i][j+3]

Expand All @@ -58,6 +63,6 @@ def largest_product(grid):
for line in file:
grid.append(line.strip('\n').split(' '))

grid = [[int(i) for i in grid[j]] for j in range(len(grid))]
grid = [[int(i) for i in grid[j]] for j in xrange(len(grid))]

print(largest_product(grid))