Skip to content

Commit 371ad32

Browse files
authored
Update helpers.go
1 parent c82043e commit 371ad32

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drafts/helpers.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ func Abs[T ordered](x, y T) T {
3333
return x - y
3434
}
3535

36-
func LowerBound[T any](arr []T, x T, func less(x, y T) bool) {
36+
func LowerBound[T any](arr []T, x T, less func (T, T) bool) int {
3737
return sort.Search(len(arr), func (i int) bool { return less(x, arr[i]) })
3838
}
3939

40-
func UpperBound[T any](arr []T, func less(x, y T) bool) {
40+
func UpperBound[T any](arr []T, x T, less func (T, T) bool) int {
4141
return sort.Search(len(arr), func (i int) bool {
4242
if i == len(arr) - 1 {
4343
return len(arr)

0 commit comments

Comments
 (0)