Sha256: b2be43453c5c0b2d1b6e8d966b5d57eef88d939bd71e0d4bb0de2cb491b25aff

Contents?: true

Size: 356 Bytes

Versions: 123

Compression:

Stored size: 356 Bytes

Contents

-module(example).

-export([distance/2, test_version/0]).

distance(Strand1, Strand2) ->
    walk(Strand1, Strand2, 0).

test_version() ->
    2.


walk([], [], Dist) -> Dist;
walk([A|As], [A|Bs], Dist) -> walk(As, Bs, Dist);
walk([_|As], [_|Bs], Dist) -> walk(As, Bs, Dist + 1);
walk(_, _, _) -> {error, "left and right strands must be of equal length"}.

Version data entries

123 entries across 123 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/erlang/exercises/hamming/src/example.erl
trackler-2.2.1.179 tracks/erlang/exercises/hamming/src/example.erl
trackler-2.2.1.178 tracks/erlang/exercises/hamming/src/example.erl
trackler-2.2.1.177 tracks/erlang/exercises/hamming/src/example.erl
trackler-2.2.1.176 tracks/erlang/exercises/hamming/src/example.erl
trackler-2.2.1.175 tracks/erlang/exercises/hamming/src/example.erl
trackler-2.2.1.174 tracks/erlang/exercises/hamming/src/example.erl
trackler-2.2.1.173 tracks/erlang/exercises/hamming/src/example.erl
trackler-2.2.1.172 tracks/erlang/exercises/hamming/src/example.erl
trackler-2.2.1.171 tracks/erlang/exercises/hamming/src/example.erl
trackler-2.2.1.170 tracks/erlang/exercises/hamming/src/example.erl
trackler-2.2.1.169 tracks/erlang/exercises/hamming/src/example.erl
trackler-2.2.1.167 tracks/erlang/exercises/hamming/src/example.erl
trackler-2.2.1.166 tracks/erlang/exercises/hamming/src/example.erl
trackler-2.2.1.165 tracks/erlang/exercises/hamming/src/example.erl
trackler-2.2.1.164 tracks/erlang/exercises/hamming/src/example.erl
trackler-2.2.1.163 tracks/erlang/exercises/hamming/src/example.erl
trackler-2.2.1.162 tracks/erlang/exercises/hamming/src/example.erl
trackler-2.2.1.161 tracks/erlang/exercises/hamming/src/example.erl
trackler-2.2.1.160 tracks/erlang/exercises/hamming/src/example.erl