LeetCode/go/patching-array_test.go
Matej Focko 898040fcad
go: add «330. Patching Array»
Signed-off-by: Matej Focko <me@mfocko.xyz>
2024-06-16 11:46:41 +02:00

22 lines
449 B
Go

package main
import (
"testing"
"github.com/stretchr/testify/assert"
)
func Test_PatchingArray_Example1(t *testing.T) {
assert := assert.New(t)
assert.Equal(1, minPatches([]int{1, 3}, 6))
}
func Test_PatchingArray_Example2(t *testing.T) {
assert := assert.New(t)
assert.Equal(2, minPatches([]int{1, 5, 10}, 20))
}
func Test_PatchingArray_Example3(t *testing.T) {
assert := assert.New(t)
assert.Equal(0, minPatches([]int{1, 2, 2}, 5))
}