Change solution to using step in range(), as well as using iterables.