diff --git a/implementation/between_two_sets.go b/implementation/between_two_sets.go new file mode 100644 index 0000000..d1fc5ab --- /dev/null +++ b/implementation/between_two_sets.go @@ -0,0 +1,18 @@ +package implementation + +// https://www.hackerrank.com/challenges/between-two-sets/problem?isFullScreen=false + +func getTotalX(a []int32, b []int32) int32 { + allFactors := []int32{} + + maxB := 0 + for i := 0; i < len(b); i++ { + maxB = max(maxB, int(b[i])) + } + + for i := 0; i < len(a); i++ { + + } + + return 0 +} diff --git a/implementation/between_two_sets_test.go b/implementation/between_two_sets_test.go new file mode 100644 index 0000000..2c6222a --- /dev/null +++ b/implementation/between_two_sets_test.go @@ -0,0 +1,37 @@ +package implementation + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +type BetweenTwoSetsTestCase struct { + a []int32 + b []int32 + result int32 +} + +func TestBetweenTwoSets(t *testing.T) { + tests := []BetweenTwoSetsTestCase{ + { + a: []int32{2, 4}, + b: []int32{16, 32, 96}, + result: 3, + }, + { + a: []int32{2, 6}, + b: []int32{24, 36}, + result: 2, + }, + { + a: []int32{3, 4}, + b: []int32{24, 48}, + result: 8, + }, + } + + for _, test := range tests { + assert.Equal(t, test.result, getTotalX(test.a, test.b)) + } +}