feat(Go-Tool):2021/03/18:新增超过半数数字系列算法题,新增出现次数不同的数字系列算法题

This commit is contained in:
Huangzj
2021-03-18 15:55:40 +08:00
parent 8dbfebe5be
commit 00ada130fa
14 changed files with 441 additions and 0 deletions
@@ -0,0 +1,19 @@
/*
* @Author : huangzj
* @Time : 2021/3/16 17:52
* @Description
*/
package NumberCount
import (
"fmt"
"testing"
)
func TestOnlyOneNumberShowOnce(t *testing.T) {
fmt.Println(OnlyOneNumberShowOnce([]int{1, 2, 3, 2, 3, 4, 4})) //1
fmt.Println(OnlyOneNumberShowOnce([]int{1, 2, 3, 2, 3, 4, 4, 1, 5})) //5
fmt.Println(OnlyOneNumberShowOnce([]int{1, 2, 3, 2, 3, 4, 4, 1, 10})) //10
fmt.Println(OnlyOneNumberShowOnce([]int{2, 2, 2, 2, 1, 3, 3, 3, 3})) //1
}