Documentation
¶
Index ¶
- func PlayMaxFruits()
- func PlayMaxSligingWindow()
- func PlayMaxSubNonRepeating()
- func PlaySlidingWindow()
- func Play_longestRepeating()
- type Deque
- func (d *Deque) Empty() bool
- func (d *Deque) Left() interface{}
- func (d *Deque) PopLeft() (res interface{})
- func (d *Deque) PopRight() (res interface{})
- func (d *Deque) PushLeft(data interface{})
- func (d *Deque) PushRight(data interface{})
- func (d *Deque) Reset()
- func (d *Deque) Right() interface{}
- func (d *Deque) Size() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PlayMaxFruits ¶
func PlayMaxFruits()
func PlayMaxSligingWindow ¶
func PlayMaxSligingWindow()
func PlayMaxSubNonRepeating ¶
func PlayMaxSubNonRepeating()
func PlaySlidingWindow ¶
func PlaySlidingWindow()
func Play_longestRepeating ¶
func Play_longestRepeating()
We have a string of length n, which consist only UPPER and LOWER CASE characters and we have a number k (always less than n and greater than 0). We can make at most k changes in our string such that we can get a sub-string of maximum length which have all same characters. Examples:
n = length of string k = changes you can make Input : n = 5 k = 2
str = ABABA
Output : maximum length = 5 which will be (AAAAA)
Input : n = 6 k = 4
str = HHHHHH
Output : maximum length=6 which will be(HHHHHH)
Types ¶
type Deque ¶
type Deque struct {
// contains filtered or unexported fields
}
Double ended queue data structure.
func (*Deque) Left ¶
func (d *Deque) Left() interface{}
Returns the leftmost element from the deque. No bounds are checked.
func (*Deque) PopLeft ¶
func (d *Deque) PopLeft() (res interface{})
Pops out an element from the queue from the left. Note, no bounds checking are done.
func (*Deque) PopRight ¶
func (d *Deque) PopRight() (res interface{})
Pops out an element from the queue from the right. Note, no bounds checking are done.
func (*Deque) PushLeft ¶
func (d *Deque) PushLeft(data interface{})
Pushes a new element into the queue from the left, expanding it if necessary.
func (*Deque) PushRight ¶
func (d *Deque) PushRight(data interface{})
Pushes a new element into the queue from the right, expanding it if necessary.