Function for finding number of subsequences which consists exactly K primes
function countSubsequences ( arr , n , k ) { var countPrime = 0 ; for ( var i = 0 ; i < n ; i ++ ) { if ( isPrime ( arr [ i ] ) ) countPrime ++ ; }