I know how to count the number of possible heaps with distinct elements such as {1, 2, 3, 4}. But if I wanted to count the number of heaps looking like this:
{1, 2, 3, 3, 4}
How do I rewrite f(N) = (N−1 C L) * f(L) * f(R) to be able to work with duplicates?