Guest User

Untitled

a guest
Feb 19th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1. apportion(Shares, Ways) when is_integer(Shares) ->
  2. apportion(lists:duplicate(Ways, 0), Shares);
  3. apportion(Acc, 0) ->
  4. Acc;
  5. apportion([H|T], Remaining) ->
  6. apportion(T ++ [H+1], Remaining - 1).
Add Comment
Please, Sign In to add comment