@@ -44,7 +44,7 @@ func (this *Main) TestInputCanBeProcessed() {
44
44
input := loadInput ("input_test" )
45
45
this .So (input , should .HaveSameTypeAs , []string {"" })
46
46
answer := processInput (input )
47
- this .So (answer , should .Equal , 157 )
47
+ this .So (answer , should .Equal , 70 )
48
48
}
49
49
50
50
func (this * Main ) TestSplitStringIntoTwoEqualParts () {
@@ -54,30 +54,16 @@ func (this *Main) TestSplitStringIntoTwoEqualParts() {
54
54
}
55
55
56
56
func (this * Main ) TestFindCommonLetter () {
57
- string1 := "vJrwpWtwJgWr"
58
- string2 := "hcsFMMfFFhFp"
59
- common := findCommonLetter (string1 , string2 )
60
- this .So (common , should .Equal , 'p' )
61
- string1 = "jqHRNqRjqzjGDLGL"
62
- string2 = "rsFMfFZSrLrFZsSL"
63
- common = findCommonLetter (string1 , string2 )
64
- this .So (common , should .Equal , 'L' )
65
- string1 = "PmmdzqPrV"
66
- string2 = "vPwwTWBwg"
67
- common = findCommonLetter (string1 , string2 )
68
- this .So (common , should .Equal , 'P' )
69
- string1 = "wMqvLMZHhHMvwLH"
70
- string2 = "jbvcjnnSBnvTQFn"
71
- common = findCommonLetter (string1 , string2 )
72
- this .So (common , should .Equal , 'v' )
73
- string1 = "ttgJtRGJ"
74
- string2 = "QctTZtZT"
75
- common = findCommonLetter (string1 , string2 )
76
- this .So (common , should .Equal , 't' )
77
- string1 = "CrZsJsPPZsGz"
78
- string2 = "wwsLwLmpwMDw"
79
- common = findCommonLetter (string1 , string2 )
80
- this .So (common , should .Equal , 's' )
57
+ string1 := "vJrwpWtwJgWrhcsFMMfFFhFp"
58
+ string2 := "jqHRNqRjqzjGDLGLrsFMfFZSrLrFZsSL"
59
+ string3 := "PmmdzqPrVvPwwTWBwg"
60
+ common := findCommonLetter (string1 , string2 , string3 )
61
+ this .So (common , should .Equal , 'r' )
62
+ string1 = "wMqvLMZHhHMvwLHjbvcjnnSBnvTQFn"
63
+ string2 = "ttgJtRGJQctTZtZT"
64
+ string3 = "CrZsJsPPZsGzwwsLwLmpwMDw"
65
+ common = findCommonLetter (string1 , string2 , string3 )
66
+ this .So (common , should .Equal , 'Z' )
81
67
}
82
68
83
69
func (this * Main ) TestMatchLettersToNumbers () {
0 commit comments