Euler #18 with Python
<p>I am trying to solve <a href="http://projecteuler.net/problem=18" rel="nofollow">project euler problem 18</a>.
<a href="http://projecteuler.net/problem=18" rel="nofollow">http://projecteuler.net/problem=18</a>
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.</p>

<p>here is the function:</p>

<pre><code>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
</code></pre>

<p>Cheers</p>
