Sha256: 574cf936038fe2a1b4f5119b075ca6f89969a704826171e8c8cadb19c5f81502

Contents?: true

Size: 1.13 KB

Versions: 68

Compression:

Stored size: 1.13 KB

Contents

package hamming

// Source: exercism/x-common
// Commit: bb56dc7 Fix canonical-data.json formatting
// x-common version: 1.0.0

var testCases = []struct {
	s1   string
	s2   string
	want int
}{
	{ // identical strands
		"A",
		"A",
		0,
	},
	{ // long identical strands
		"GGACTGA",
		"GGACTGA",
		0,
	},
	{ // complete distance in single nucleotide strands
		"A",
		"G",
		1,
	},
	{ // complete distance in small strands
		"AG",
		"CT",
		2,
	},
	{ // small distance in small strands
		"AT",
		"CT",
		1,
	},
	{ // small distance
		"GGACG",
		"GGTCG",
		1,
	},
	{ // small distance in long strands
		"ACCAGGG",
		"ACTATGG",
		2,
	},
	{ // non-unique character in first strand
		"AGA",
		"AGG",
		1,
	},
	{ // non-unique character in second strand
		"AGG",
		"AGA",
		1,
	},
	{ // same nucleotides in different positions
		"TAG",
		"GAT",
		2,
	},
	{ // large distance
		"GATACA",
		"GCATAA",
		4,
	},
	{ // large distance in off-by-one strand
		"GGACGGATTCTG",
		"AGGACGGATTCT",
		9,
	},
	{ // empty strands
		"",
		"",
		0,
	},
	{ // disallow first strand longer
		"AATG",
		"AAA",
		-1,
	},
	{ // disallow second strand longer
		"ATA",
		"AGTG",
		-1,
	},
}

Version data entries

68 entries across 68 versions & 1 rubygems

Version Path
trackler-2.2.1.6 tracks/go/exercises/hamming/cases_test.go
trackler-2.2.1.5 tracks/go/exercises/hamming/cases_test.go
trackler-2.2.1.4 tracks/go/exercises/hamming/cases_test.go
trackler-2.2.1.3 tracks/go/exercises/hamming/cases_test.go
trackler-2.2.1.2 tracks/go/exercises/hamming/cases_test.go
trackler-2.2.1.1 tracks/go/exercises/hamming/cases_test.go
trackler-2.2.1.0 tracks/go/exercises/hamming/cases_test.go
trackler-2.2.0.6 tracks/go/exercises/hamming/cases_test.go
trackler-2.2.0.5 tracks/go/exercises/hamming/cases_test.go
trackler-2.2.0.4 tracks/go/exercises/hamming/cases_test.go
trackler-2.2.0.3 tracks/go/exercises/hamming/cases_test.go
trackler-2.2.0.2 tracks/go/exercises/hamming/cases_test.go
trackler-2.2.0.1 tracks/go/exercises/hamming/cases_test.go
trackler-2.2.0.0 tracks/go/exercises/hamming/cases_test.go
trackler-2.1.0.55 tracks/go/exercises/hamming/cases_test.go
trackler-2.1.0.54 tracks/go/exercises/hamming/cases_test.go
trackler-2.1.0.53 tracks/go/exercises/hamming/cases_test.go
trackler-2.1.0.52 tracks/go/exercises/hamming/cases_test.go
trackler-2.1.0.51 tracks/go/exercises/hamming/cases_test.go
trackler-2.1.0.50 tracks/go/exercises/hamming/cases_test.go