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