You have an unwanted string of characters. Unfortunately, you can't just apply
delete
because your keyboard's
d
key isn't working. The only operation is
break
, which remove a subsegment consists of the same characters and concatenate both ends. What is the minimum number of
break
you need to apply to completely delete
this string
?
Explicit Example
ababa
is 3.
abbccbba
is 3.
abcdefghi
is 9.
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
I think the correct answer is not 12, but 13!
Python3