Erlang:
note: I followed the link to the codewars page and am using their list of distances. I also assume Granny is coming home after visiting her friends. A different list of distances can be passed in, without limit on length. But if the correlation between friend1 is in town1 breaks down then I'd need to add a map/hashtable for that lookup.
Erlang:
note: I followed the link to the codewars page and am using their list of distances. I also assume Granny is coming home after visiting her friends. A different list of distances can be passed in, without limit on length. But if the correlation between friend1 is in town1 breaks down then I'd need to add a map/hashtable for that lookup.
devto6:find_distance([100, 200, 250, 300]).
889.0363202746577