News for hackers. Stuff that matters.
Re:On Secretly Terrible Engineers by mden on Sunday March 08, 2015 @06:56PM (#9167748)
Fyi, there's a mistake in your second solution - consider a strictly increasing list.
Re:On Secretly Terrible Engineers by Luyt on Sunday March 08, 2015 @07:23PM (#9167842)
Thanks for the tip!

    a = [2, 7, 8, 9]

    highest = nexthighest = None

    for item in a:
        if not highest:
            highest = item
        elif item > highest:
            nexthighest = highest    
            highest = item
        elif not nexthighest:
            nexthighest = item
        elif item > nexthighest:
            nexthighest = item

    print highest + nexthighest