How to solve this string edit problem

Правка en1, от RNR, 2019-03-09 22:40:32

How to solve a generalization of this problem?

Given a string, remove identical consecutive letters ( not only pair as mentioned in the above question).

For example, if you have

wwwhaat --> ht
whhhaah --> w
reallazy --> rezy

Can someone suggest me an algorithm? For finding the minimum string at the end of this deletion?

Теги #strings, #problem solving

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский RNR 2019-03-09 22:55:28 16 Tiny change: 'ah --> w\nr' -> 'ah --> w\nwhaahhhh --> w\nr'
en1 Английский RNR 2019-03-09 22:40:32 447 Initial revision (published)