diff --git a/20210109/main.go b/20210109/main.go new file mode 100644 index 0000000..0be6683 --- /dev/null +++ b/20210109/main.go @@ -0,0 +1,16 @@ +package main + +func main() { + +} + +func search(n int, nums []int) int { + l := len(nums) + c := l / 2 + for { + if c == 0 { + + } + } + return -1 +} diff --git a/20210109/main_test.go b/20210109/main_test.go new file mode 100644 index 0000000..1a9e4f9 --- /dev/null +++ b/20210109/main_test.go @@ -0,0 +1,28 @@ +package main + +import "testing" + +func Test_search(t *testing.T) { + type args struct { + n int + nums []int + } + tests := []struct { + name string + args args + want int + }{ + { + "test1", + args{9, []int{-1, 0, 3, 5, 9, 12}}, + 4, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if got := search(tt.args.n, tt.args.nums); got != tt.want { + t.Errorf("search() = %v, want %v", got, tt.want) + } + }) + } +}