Sha256: 10318599a296e2bdd7dc27c557de08d317efad96ff320b395f669f87a7bd9487
Contents?: true
Size: 372 Bytes
Versions: 166
Compression:
Stored size: 372 Bytes
Contents
using System; using System.Linq; public static class Hamming { public static int Distance(string firstStrand, string secondStrand) { if (firstStrand.Length != secondStrand.Length) { throw new ArgumentException("strand lengths must be equal"); } return firstStrand.Where((x, i) => x != secondStrand[i]).Count(); } }
Version data entries
166 entries across 166 versions & 1 rubygems