Apply .gitignore rules

This commit is contained in:
皮蛋13361098506
2025-01-06 16:21:36 +08:00
parent 1b77f62820
commit ccd2c530cf
580 changed files with 69806 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
package mathUtil
import (
"fmt"
)
// int类型区间对象表示连续的int类型区间
type IntRegion struct {
Lower int
Upper int
}
func (this *IntRegion) String() string {
return fmt.Sprintf("%d-%d", this.Lower, this.Upper)
}
// 是否包含指定的值
func (this *IntRegion) Contains(value int) bool {
return this.Lower <= value && value <= this.Upper
}
// 是否是有序的
func (this *IntRegion) IsSorted() bool {
return this.Lower < this.Upper
}
// 创建int类型区间对象
func NewIntRegion(lower, upper int) *IntRegion {
return &IntRegion{
Lower: lower,
Upper: upper,
}
}