I have an array of 100 products. Each product has a some attributes, category being one of them. Among the 100 products I want to select first n elements such that there are a minimum of m elements from each category.I have an array of 100 products. Each product h