Skip to content

Commit

Permalink
feat: add temporary beaultiful triplets problem
Browse files Browse the repository at this point in the history
  • Loading branch information
leometzger committed Aug 13, 2023
1 parent 89112cd commit e0ab07c
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
5 changes: 5 additions & 0 deletions implementation/beautiful_triplets.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package implementation

func beautifulTriplets(d int32, arr []int32) int32 {
return 0
}
32 changes: 32 additions & 0 deletions implementation/beautiful_triplets_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package implementation

import (
"testing"

"github.com/stretchr/testify/assert"
)

type beautifulTripletsTestCase struct {
d int32
arr []int32
result int32
}

func TestBeaultifulTriplets(t *testing.T) {
tests := []beautifulTripletsTestCase{
{
result: 3,
d: 3,
arr: []int32{1, 2, 4, 5, 7, 8, 10},
},
{
result: 2,
d: 3,
arr: []int32{1, 6, 7, 7, 8, 10, 12, 13, 14, 19},
},
}

for _, test := range tests {
assert.Equal(t, test.result, beautifulTriplets(test.d, test.arr))
}
}

0 comments on commit e0ab07c

Please sign in to comment.