considering present character as the second digit of two digits no we check if the value of this key is marked in hash or not If marked then we a have a number divisible by 8
if ( visited [ mp . get ( str [ i ] . charCodeAt ( 0 ) - ' ' . charCodeAt ( 0 ) ) ] ) { document . write ( " " ) ; break ; } visited [ str [ i ] . charCodeAt ( 0 ) - ' ' . charCodeAt ( 0 ) ] = true ; }