** The data is a sample data of 20 orders across a universe of 3 stores.Trying to write an algorithm to identify which store would cater to which order based on the rules **
If there is more than 1 store eligible for an order, the store that has catered to the least quantities of order cumulatively will cater to the current order. For example, If S1, S2, & S3 has catered to 100, 150, 75 units of orders till order #3 and S1 & S2 are eligible for order #4, then S1 will cater to order #4
OrderNum|OrderQty|StoresEligible
------- |--------|--------------
1|12|S3
2|10|S1
3|19|S1,S2
4|7|S1,S2
5|14|S1,S2,S3
6|19|S2
7|5|S1,S2
8|17|S2
9|13|S3
10|5|S1
In reality, there are 2,000 stores in the US and 1M orders