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.78 tracks/erlang/exercises/hamming/src/example.erl
trackler-2.2.1.77 tracks/erlang/exercises/hamming/src/example.erl
trackler-2.2.1.76 tracks/erlang/exercises/hamming/src/example.erl
trackler-2.2.1.75 tracks/erlang/exercises/hamming/src/example.erl
trackler-2.2.1.74 tracks/erlang/exercises/hamming/src/example.erl
trackler-2.2.1.73 tracks/erlang/exercises/hamming/src/example.erl
trackler-2.2.1.72 tracks/erlang/exercises/hamming/src/example.erl
trackler-2.2.1.71 tracks/erlang/exercises/hamming/src/example.erl
trackler-2.2.1.70 tracks/erlang/exercises/hamming/src/example.erl
trackler-2.2.1.69 tracks/erlang/exercises/hamming/src/example.erl
trackler-2.2.1.68 tracks/erlang/exercises/hamming/src/example.erl
trackler-2.2.1.67 tracks/erlang/exercises/hamming/src/example.erl
trackler-2.2.1.66 tracks/erlang/exercises/hamming/src/example.erl
trackler-2.2.1.65 tracks/erlang/exercises/hamming/src/example.erl
trackler-2.2.1.64 tracks/erlang/exercises/hamming/src/example.erl
trackler-2.2.1.63 tracks/erlang/exercises/hamming/src/example.erl
trackler-2.2.1.62 tracks/erlang/exercises/hamming/src/example.erl
trackler-2.2.1.61 tracks/erlang/exercises/hamming/src/example.erl
trackler-2.2.1.60 tracks/erlang/exercises/hamming/src/example.erl
trackler-2.2.1.59 tracks/erlang/exercises/hamming/src/example.erl