I think the check is needed in your current code, as you're avoiding the pre-increment in the while condition, which will screw up the s != e check later.

IMO my version is just as good and easier to read.