## Invitation to Computer Science 8th Edition

The first one( Fig 1.3$)$ is more efficient and elegant since it would look the same regardless of how many times the loop has to be performed. Only the value of WashCount would change.