tidy up
This commit is contained in:
@@ -56,12 +56,12 @@ solution2(Table) ->
|
|||||||
|
|
||||||
|
|
||||||
get_basins(Low_points, Table) ->
|
get_basins(Low_points, Table) ->
|
||||||
get_basins(Low_points, Table, 0, []).
|
get_basins(Low_points, Table, []).
|
||||||
|
|
||||||
get_basins([], _Table, _, Basins) -> Basins;
|
get_basins([], _Table, Basins) -> Basins;
|
||||||
get_basins([Low_point|Rest], Table, Count, Basins) ->
|
get_basins([Low_point|Rest], Table, Basins) ->
|
||||||
Basin = [Low_point|lists:usort(get_up_slopes([Low_point], Table))],
|
Basin = [Low_point|lists:usort(get_up_slopes([Low_point], Table))],
|
||||||
get_basins(Rest, Table, Count + 1, [Basin|Basins]).
|
get_basins(Rest, Table, [Basin|Basins]).
|
||||||
|
|
||||||
low_points([H|_] = Table) ->
|
low_points([H|_] = Table) ->
|
||||||
X = length(H),
|
X = length(H),
|
||||||
|
|||||||
Reference in New Issue
Block a user