Skip to content

Commit

Permalink
feat: add down to zero
Browse files Browse the repository at this point in the history
  • Loading branch information
leometzger committed Aug 12, 2023
1 parent b85bce3 commit 6241cbb
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
5 changes: 5 additions & 0 deletions datastructures/down_to_zero_ii.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package datastructures

func downToZero(n int32) int32 {
return 0
}
23 changes: 23 additions & 0 deletions datastructures/down_to_zero_ii_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package datastructures

import (
"testing"

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

type DownToZeroIITestCase struct {
n int32
result int32
}

func TestDownToZeroII(t *testing.T) {
tests := []DownToZeroIITestCase{
{n: 3, result: 3},
{n: 4, result: 3},
}

for _, test := range tests {
assert.Equal(t, test.result, downToZero(test.n))
}
}

0 comments on commit 6241cbb

Please sign in to comment.