logoalt Hacker News

cowsandmilklast Friday at 11:33 AM2 repliesview on HN

How horridly inefficient, he should have just flipped a Boolean on each iteration.


Replies

krooliklast Friday at 11:41 AM

Horridly inefficient. Just unfold the loop.

projektfulast Friday at 12:35 PM

Just output odd and even for each pass and increment by two. Need to make sure you have the right starting value, and check for off-by-one errors.