#include <iostream>
#include <string>
#include <algorithm>
#include <iterator>
struct BothAre
{
char c;
BothAre(char r) : c(r) {}
bool operator()(char l, char r) const
{
return r == c && l == c;
}
};
int main()
{
std::string str = "I Like StackOverflow a lot";
std::string::iterator i = unique(str.begin(), str.end(), BothAre(' '));
std::copy(str.begin(), i, std::ostream_iterator<char>(std::cout, ""));
std::cout << '\n';
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8YWxnb3JpdGhtPgojaW5jbHVkZSA8aXRlcmF0b3I+CnN0cnVjdCBCb3RoQXJlCnsKICAgIGNoYXIgYzsKICAgIEJvdGhBcmUoY2hhciByKSA6IGMocikge30KICAgIGJvb2wgb3BlcmF0b3IoKShjaGFyIGwsIGNoYXIgcikgY29uc3QKICAgIHsKICAgICAgICAgICAgcmV0dXJuIHIgPT0gYyAmJiBsID09IGM7CiAgICB9Cn07CmludCBtYWluKCkKewogICAgc3RkOjpzdHJpbmcgc3RyID0gIkkgICAgTGlrZSAgICBTdGFja092ZXJmbG93IGEgICAgICBsb3QiOwogICAgc3RkOjpzdHJpbmc6Oml0ZXJhdG9yIGkgPSB1bmlxdWUoc3RyLmJlZ2luKCksIHN0ci5lbmQoKSwgQm90aEFyZSgnICcpKTsKICAgIHN0ZDo6Y29weShzdHIuYmVnaW4oKSwgaSwgc3RkOjpvc3RyZWFtX2l0ZXJhdG9yPGNoYXI+KHN0ZDo6Y291dCwgIiIpKTsKICAgIHN0ZDo6Y291dCA8PCAnXG4nOwp9Cg==