Jump to Python Chapter 8, Comprehensive Question No. 13, and when I solved it like this, the result came out as "a1b1c1a1". I don't know why all the CNTs come out as 1.
There seems to be a mistake in the cnt increase or decrease expression when the same character is continuous.
I keep saving 1 whenever the characters are continuous, so I think the final value is also 1.
And it's not mandatory, but it's easier for us to do it ourselves if you write the code yourself rather than capture it! Enjoy coding :)
© 2022 pinfo. All rights reserved.