Function to find the longest subsequence which contain all consonants
function longestConsonantsSubsequence ( str ) { var answer = " " ; var n = str . length ; for ( var i = 0 ; i < n ; i ++ ) { if ( isConsonants ( str [ i ] ) ) { answer += str [ i ] ; } } return answer ; }