Ad
  • Default User Avatar

    In this case as in any other case I think it is sensible to avoid nesting loops.
    Nested loops make for hard to understand code and do push your algorithm into a higher complexity. Depending on the problem at hand (large n) this can be a deal breaker.

  • Default User Avatar

    @gobe I like that you thought of the lines as relation between space and star and not just from the starpoint of view.
    Makes your code easy to read and understand.