Swap the first characters
if ( p [ 0 ] !== q [ 0 ] ) { p = p . split ( " " ) ; q = q . split ( " " ) ; var temp = p [ 0 ] ; p [ 0 ] = q [ 0 ] ; q [ 0 ] = temp ; p = p . join ( " " ) ; q = q . join ( " " ) ; var flag1 = 0 ; var flag2 = 0 ;