Split value in 24 randomly sized parts using C# -
I have a value, say 20010. I want to split this value randomly for 24 hours. So basically the value is divided into 24 slots large arrays, where all the slots are randomly incremented.
What is a good way to solve this by using C #?
random (without duplicates) 23 (not 24) number outlined in 1 to 2, 2000. Add 0 and 20010 and order these numbers, the difference gives you a slot value between two consecutive numbers.
An online approach is also possible by pulling one value at a time and subtracting it from "pot" when the number is big. However this can be the maximum deviation of the size of the slot from this perspective.
Comments
Post a Comment