Sha256: 182839e8539f1ebb279e9b6f661aba13cbdf2b6ab570d28a3b353f5031240e54

Contents?: true

Size: 1.18 KB

Versions: 82

Compression:

Stored size: 1.18 KB

Contents

package hamming

// Source: exercism/problem-specifications
// Commit: b5d154b hamming: move inputs (strand1, strand2) to input object
// Problem Specifications Version: 2.1.0

var testCases = []struct {
	s1   string
	s2   string
	want int
}{
	{ // empty strands
		"",
		"",
		0,
	},
	{ // 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
		"AAG",
		"AAA",
		1,
	},
	{ // non-unique character in second strand
		"AAA",
		"AAG",
		1,
	},
	{ // same nucleotides in different positions
		"TAG",
		"GAT",
		2,
	},
	{ // large distance
		"GATACA",
		"GCATAA",
		4,
	},
	{ // large distance in off-by-one strand
		"GGACGGATTCTG",
		"AGGACGGATTCT",
		9,
	},
	{ // disallow first strand longer
		"AATG",
		"AAA",
		-1,
	},
	{ // disallow second strand longer
		"ATA",
		"AGTG",
		-1,
	},
}

Version data entries

82 entries across 82 versions & 1 rubygems

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