/** * Definition for an interval. * type Interval struct { * Start int * End int * } */ type SummaryRanges struct { intervals []Interval } /** Initialize your data structure here. */ func Constructor() SummaryRanges { return SummaryRanges{} } func (this *SummaryRanges) AddNum(val int) { beg, end := 0, len(this.intervals) for beg < end { } } func (this *SummaryRanges) GetIntervals() []Interval { } /** * Your SummaryRanges object will be instantiated and called as such: * obj := Constructor(); * obj.AddNum(val); * param_2 := obj.GetIntervals(); */