In the official solution, the method of this problem is described as below:
Click to see the method
But, what the f**k is the official standard code writing! It is considering a word is nice if the number of occurrences of A
and B
is even. It didn't even use a stack as the method above mentioned!
Click to see the official standard code
9 years passed and didn't even a single person mentioned this mistake???