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