Write a function `generatePairs` that accepts an integer argument `n` and generates an array containing the pairs of integers `[a, b]` that satisfy the following conditions:
```
0 <= a <= b <= n
```

The pairs should be sorted by increasing values of `a` then increasing values of `b`.

For example, `generatePairs(2)` should return
```
[ [0, 0], [0, 1], [0, 2], [1, 1], [1, 2], [2, 2] ]
```

Difficulty: EASY
Starter code: def generate_pairs(n):
	

Solutions:
def generate_pairs(n):
	return [[i, j] for i in range(n + 1) for j in range(i, n + 1)]


def generate_pairs(n):
	return [[a, b] for a in range(n + 1) for b in range(a, n + 1)]


def generate_pairs(n):
	return [[i, y] for i in range(n + 1) for y in range(i, n + 1)]


from itertools import combinations_with_replacement

def generate_pairs(n, m=2):
	return list(map(list, combinations_with_replacement(range(n + 1), m)))


from itertools import combinations_with_replacement

def generate_pairs(n):
	return [list(a) for a in combinations_with_replacement(range(n + 1), 2)]


def generate_pairs(n):
	b = [[y, x] for x in range(n + 1) for y in range(x + 1)]
	b.sort()
	return b


def generate_pairs(n):
	return [[i, x] for i in range(n + 1) for x in range(n + 1) if x >= i]


from itertools import chain

def generate_pairs(n):
	return sorted(list(chain.from_iterable([[[a, b] for a in range(b + 1)] for b in range(n + 1)])))