Function to return the bitmask for the string
function getBitmask ( s ) { var temp = 0 ; for ( var j = 0 ; j < s . length ; j ++ ) { switch ( s [ j ] ) { case " " : temp = temp | 1 ; break ; case " " : temp = temp | 2 ; break ; case " " : temp = temp | 4 ; break ; case " " : temp = temp | 8 ; break ; case " " : temp = temp | 16 ; break ; case " " : temp = temp | 32 ; break ; default : break ; } } return temp ; }