mirror of
https://github.com/halfrost/LeetCode-Go.git
synced 2025-07-25 03:11:41 +08:00
22 lines
564 B
Go
22 lines
564 B
Go
package leetcode
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
)
|
|
|
|
func Test_Problem352(t *testing.T) {
|
|
obj := Constructor352()
|
|
fmt.Printf("obj = %v\n", obj)
|
|
obj.AddNum(1)
|
|
fmt.Printf("Intervals = %v\n", obj.GetIntervals()) // [1,1]
|
|
obj.AddNum(3)
|
|
fmt.Printf("Intervals = %v\n", obj.GetIntervals()) // [1,1] [3,3]
|
|
obj.AddNum(7)
|
|
fmt.Printf("Intervals = %v\n", obj.GetIntervals()) // [1, 1], [3, 3], [7, 7]
|
|
obj.AddNum(2)
|
|
fmt.Printf("Intervals = %v\n", obj.GetIntervals()) // [1, 3], [7, 7]
|
|
obj.AddNum(6)
|
|
fmt.Printf("Intervals = %v\n", obj.GetIntervals()) // [1, 3], [6, 7]
|
|
}
|