Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- apportion(Shares, Ways) when is_integer(Shares) ->
- apportion(lists:duplicate(Ways, 0), Shares);
- apportion(Acc, 0) ->
- Acc;
- apportion([H|T], Remaining) ->
- apportion(T ++ [H+1], Remaining - 1).
Add Comment
Please, Sign In to add comment