Returns nCr for the given values of r and n
static long nCr ( int n , int r ) { return fact ( n ) / ( 1 * fact ( r ) * fact ( n - r ) ) ; } static long number_of_subsequences ( int arr [ ] , int k , int n ) { long s = 0 ;