On Wed, Nov 10, 2010 at 09:45:43PM +0530, C K Kashyap wrote: > Aren't the list comprehension approach exponential in complexity - > whereas the others linear? No, they have exactly the same complexity. The list comprehension simply desugars into something very similar to the other solutions anyway. -Brent