Count all unique outcomes possible by performing S flips on N coins | C # program for the above approach ; Function to recursively count the number of unique outcomes possible S flips are performed on N coins ; Base Cases ; Recursive Calls ; Driver Code
using System ; class GFG { static int numberOfUniqueOutcomes ( int N , int S ) { if ( S < N ) return 0 ; if ( N == 1 N == S ) return 1 ; return ( numberOfUniqueOutcomes ( N - 1 , S - 1 ) + numberOfUniqueOutcomes ( N - 1 , S - 2 ) ) ; } static public void Main ( ) { int N = 3 , S = 4 ; Console . WriteLine ( numberOfUniqueOutcomes ( N , S ) ) ; } }