| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 | type minHeap []int // Stores the length onlyfunc (h minHeap) Len() int           { return len(h) }func (h minHeap) Less(i, j int) bool { return h[i] < h[j] }func (h minHeap) Swap(i, j int)      { h[i], h[j] = h[j], h[i] }func (h *minHeap) Push(x interface{}) {	*h = append(*h, x.(int))}func (h *minHeap) Pop() interface{} {	l := len(*h)	x := (*h)[l-1]	*h = (*h)[0 : l-1]	return x}var m map[int]*minHeapfunc isPossible(nums []int) bool {	m = make(map[int]*minHeap)	for _, num := range nums {		last := helper(num - 1)		l := 0		if last.Len() != 0 {			l = heap.Pop(last).(int)		}		curr := helper(num)		heap.Push(curr, l+1)	}	for _, v := range m {		h := *v		for _, l := range h {			if l < 3 {				return false			}		}	}	return true}func helper(num int) *minHeap {	if h, ok := m[num]; ok {		return h	} else {		var h minHeap		m[num] = &h		return &h	}}
 |