Find repeating adjacent characters in a string
In an interview, I was asked to remove all repeating adjacent characters in a string except one. For example,
input : abbccasdjajksdhkjaaaaa
output : abcasdjajksdhkja
In Java, the syntax will be
s.replaceAll("(.)\\1{1,}", "$1");...
Submitted by anonymous - 4 years ago