![]() #Creating boolean and setting it to false #Stores sum of 21 numbers needed for array Is there a better way of doing this? def createUniqueArray():Īrray_of_nums = I need every possible combination(or as much as I can get) and the way I am doing it now is taking forever as I'm creating a random array and then checking if it already exists. However the products at the end of the list aren't being allocated anything. ![]() If it's populating the last element in the array, it populates with 100 - total count. I have tried code where I have an array of numbers, 0 - 100 in increments of 5, where I pull a increment as long as the total count does not exceed 100. I need to find out every combination of of the percentage allocations. Allocation of 0% is allowed on products, and so is 100%. Within all the products, their must be a sum of 100%. A product can be assigned an increment of 5%.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |