The count for ways of doing each way of matching the bins was (popcount - popbinheight) ^ (sampcount - sampbinheight).

If we already know which sampbinheight bins areĀ