3 ms·
Addition and comparison will suffice: https://gist.github.com/garethjwilliams/7202128 https://gist.github.com/garethjwilliams/7202128
by gmantastic 13y ago
Addition and comparison will suffice: https://gist.github.com/garethjwilliams/7202128 https://gist.github.com/garethjwilliams/7202128
- deletes 13y agoAwesome solution, but it breaks if you change the iteration range.
- gmantastic 13y agoYeah, you're stuck with counting up from 1, although you could tweak it to suppress the output prior to a starting point.
- deletes 13y agoHere is my C solution for arbitrary positive range: http://ideone.com/a0EdtS http://ideone.com/a0EdtS
- gmantastic 13y agoNice, I get it. Here's mine tweaked - not so clever: https://gist.github.com/garethjwilliams/7210264 https://gist.github.com/garethjwilliams/7210264