Euler #18 with Python
I am trying to solve project euler problem 18.
I tried a greedy algorithm with python working from the bottom of the triangle.
THen I move up one row and find the biggest route with a greedy algorithm and try to connect the biggest route but it doesn't work. DO you have any hints that would put me on the right track without giving the solution of the problem away.

here is the function:
   ## def greedy(i):
    if i%15==0:
        a=[(b[i-15],i-15),(b[i-14],i-14)]
        a=sorted(a)
        a=a[-1]
    else:
        a=[(b[i-15],i-15),(b[i-16],i-16),(b[i-14],i-14)]
        a=sorted(a)
        a=a[-1]
    return a#

Cheers
Euler #18 with Python
===

I am trying to solve project euler problem 18.
I tried a greedy algorithm with python working from the bottom of the triangle.
THen I move up one row and find the biggest route with a greedy algorithm and try to connect the biggest route but it doesn't work. DO you have any hints that would put me on the right track without giving the solution of the problem away.

here is the function:
   ## def greedy(i):
    if i%15==0:
        a=[(b[i-15],i-15),(b[i-14],i-14)]
        a=sorted(a)
        a=a[-1]
    else:
        a=[(b[i-15],i-15),(b[i-16],i-16),(b[i-14],i-14)]
        a=sorted(a)
        a=a[-1]
    return a#

Cheers