I am stuck in a scenario which is complex for me to implement. Scenario is : I have rows in excel sheet which is dynamic . sometimes it could be 2, sometimes 5, sometimes 12 means any number of rows could be there. i need to assign different unique values to each available row in such a way that their sum should be equal to 100. Example : if i have 2 rows i can assign values 65 and 35 but not 50 to both as the value needs to be unique. similarly if i have 4 rows i need to assign values like 20,30, 27, 23 .
How can i do this ? Need help with this one ASAP. It is an urgent one.
this solution is working fine. But there is one condition that i just got to know from the business team that the values to be assigned should not be less than 10. Can you modify this accordingly? is it possible ?
following approach from @Yoichi
we would change
Enumerable.Range(10,numberOfRows -1) But then the maximum numbers of rows will be 8
in case of you need more dynamics within the different numbers, just let us know.