Compute the support of an itemset: the fraction of transactions that contain every item of the itemset. Items inside a transaction are treated as a set.
Implement solve(transactions,itemset).
Returns. Return a float in [0,1]. The empty itemset is contained in every transaction, so its support is 1.0. There must be at least one transaction.
Example 1
Input:
solve([['a', 'b'], ['a', 'c'], ['a', 'b']], ['a', 'b'])
Output:
0.666667
Example 2
Input:
solve([['a', 'b'], ['a', 'c'], ['a', 'b']], ['c'])
Output:
0.333333
No results yet
Run your code to check it against the examples, or submit to run every test.