Erlang Distinct
-module(distinct).
-export([distinct/1]).
distinct(A) ->
length(lists:usort(A)).
This counts unique values by tracking what has already been seen.
-module(distinct).
-export([distinct/1]).
distinct(A) ->
length(lists:usort(A)).
This counts unique values by tracking what has already been seen.