Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Homogeneous ordering method
- ===========================
- - We assume we have the list of campaigns (ordered by leads size) [{camp1: [listOfLeads]}, {camp2: [listOfLeads]}, ...]
- - We take the 2 first campaigns and compare the leads size to get the difference, then we save the difference (leads) in another variable. camp1 has 250, camp2 has 230, remainingLeads = 20 remaining leads. That way, we have camp1 and camp2 with 230 leads each.
- - We zip camp1 and camp2 leads and push them to a variable. result = zip(camp1.listOfLeads, camp2.listOfLeads)
- - We divide the result variable length by the remainingLeads to get a step to push the remaining leads. step = result/remainingLeads ; 460/20 = 23
- - We push the 20 remaining leads each 23 items
- - We start over again for the rest of the campaigns. The next comparison will not compare camp1, but the result variable with camp3
- Considerations:
- - If camp1 has the double or more leads than camp2, we divide the length to get the step value (round to floor) and push to the result variable (example: 24038(camp1)/11543(camp2) = 2.08247(step); 2(roundStep))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement