One of the two distinct must appear exactly once . Either the first entry appears once , or it appears n / k - 1 times to make other substring appear once .
if ( entry . getValue ( ) == ( n / k - 1 ) || entry . getValue ( ) == 1 ) return true ; return false ; }