checks whether a string has similar characters side by side
#include <bits/stdc++.h> NEW_LINE using namespace std ; bool sameCharAdj ( string str ) { int n = str . length ( ) , i ; set < char > st ; st . insert ( str [ 0 ] ) ; for ( i = 1 ; i < n ; i ++ ) {