checks whether a String has similar characters side by side
using System ; using System . Collections . Generic ; class GFG { static bool sameJavaharAdj ( char [ ] str ) { int n = str . Length , i ; HashSet < char > st = new HashSet < char > ( ) ; st . Add ( str [ 0 ] ) ; for ( i = 1 ; i < n ; i ++ ) {