Function to check if all characters are distinct
function ifAllDistinct ( str ) { var s = new Array ( ) ; var temp = str . split ( " " ) ; for ( const c of temp ) { s . push ( c ) ; } var set = new Set ( s ) ; return set . size === str . length ; }