## Task:
You have to write a function `pattern` which returns the following Pattern(See Pattern & Examples) upto `n` number of rows. 

* Note:`Returning` the pattern is not the same as `Printing` the pattern.

#### Rules/Note:
* If `n < 1` then it should return "" i.e. empty string.
* There are `no whitespaces` in the pattern.

### Pattern: 

    1
    22
    333
    ....
    .....
    nnnnnn
    
### Examples:

+ pattern(5):

      1
      22
      333
      4444
      55555
      
* pattern(11):  

      1
      22
      333
      4444
      55555
      666666
      7777777
      88888888
      999999999
      10101010101010101010
      1111111111111111111111

```if-not:cfml
* Hint: Use \n in string to jump to next line
```
```if:cfml
* Hint: Use Chr(10) in string to jump to next line
```
[List of all my katas]('http://www.codewars.com/users/curious_db97/authored')

Difficulty: EASY
Tags: String algorithms

Ad-hoc

Starter code:
def pattern(n):
	

Solutions:
def pattern(n):
	return '\n'.join([x * str(x) for x in range(1, n + 1)])


def pattern(n):
	result = ''
	for i in range(1, n + 1):
		result += str(i) * i + '\n'
	return result[:-1]


def pattern(n):
	return '\n'.join((str(i) * i for i in range(1, n + 1)))


pattern = lambda n: '\n'.join([str(x) * x for x in range(1, n + 1)])


def pattern(n):
	if n < 1:
		return ''
	elif n == 1:
		return str(1)
	else:
		return pattern(n - 1) + '\n' + str(n) * n


def pattern(n):
	L = []
	for i in range(1, n + 1):
		L.append(str(i) * i)
	return '\n'.join(L)


def pattern(n):
	return ''.join(list([str(x) * x + '\n' if n > x else str(x) * x for x in range(1, n + 1)]))


def pattern(n):
	if n > 0:
		m = '1'
		for i in range(1, n):
			h = ''
			for j in range(i + 1):
				h += str(i + 1)
			m += '\n' + h
		return m
	else:
		return ''


def pattern(n):
	pat = ''
	for i in range(1, n):
		pat += str(i) * i + '\n'
	pat += str(n) * n
	return pat


def pattern(n):
	if n < 1:
		return ''
	else:
		string = ''
		for i in range(1, n):
			string += str(i) * i + '\n'
		string += str(n) * n
		return string


def pattern(n):
	if n < 1:
		return ''
	p = []
	for x in range(1, n + 1):
		p.append(str(x) * x)
	return '\n'.join((str(i) for i in p))


def pattern(n):
	return '\n'.join([str(i) * i for i in range(1, n + 1)]) if n > 0 else ''


def pattern(n):
	return '\n'.join([str(cw) * cw for cw in range(1, n + 1)])


def pattern(n):
	s = ''
	for i in range(1, n + 1):
		for j in range(1, i + 1):
			s = s + str(i)
		if i < n:
			s = s + '\n'
	return s


def pattern(n):
	x = 1
	L = []
	while x <= n:
		result = x * str(x)
		x = x + 1
		L.append(result)
	if n < 1:
		pat = ''
	else:
		pat = '\n'.join(L)
	return pat


def pattern(n):
	message_to_return = []
	if n >= 1:
		for i in range(1, n + 1):
			message_to_return.append(''.join([str(i)] * i))
	return '\n'.join(message_to_return)


def pattern(n):
	return '\n'.join([str(e) * e for e in range(1, n + 1)])


def pattern(n):
	inList = list([str(x) * x for x in [x for x in range(1, n + 1)]])
	return '\n'.join(inList)


def pattern(n):
	return '\n'.join((str(num) * num for num in range(1, n + 1)))


def pattern(n):
	return ''.join(['{}{}'.format(str(i) * int(i), '\n') for i in range(1, n + 1)])[:-1]


pattern = lambda n: '\n'.join((str(a) * a for a in range(1, n + 1)))


def pattern(n):
	x = 1
	new = ''
	while x < n + 1 and n > 0:
		new += str(x) * x + '\n'
		x += 1
	return new[0:len(new) - 1]


def pattern(n):
	return '\n'.join((f'{str(i) * i}' for i in range(1, n + 1) if n >= 1))


def pattern(n):
	empty_s = ''
	if isinstance(n, str):
		return '1'
	elif n >= 1:
		for i in range(1, n + 1):
			empty_s += f'{str(i) * i}\n'
		return empty_s[:-1]
	else:
		return ''


def pattern(n):
	return '\n'.join([str(r) * r for r in range(1, n + 1)])


def pattern(n):
	return '\n'.join((str(loop) * loop for loop in range(1, n + 1)))


def pattern(n):
	if n <= 0:
		return ''
	ans = '1'
	for i in range(1, n):
		ans = ans + '\n' + str(i + 1) * (i + 1)
	return ans


def pattern(n):
	imprimir = []
	for i in range(1, n + 1):
		patron = str(i) * i
		imprimir.append(patron)
		'\n'.join(imprimir)
	return '\n'.join(imprimir)


def pattern(n):
	result = ''
	if n < 1:
		return ''
	else:
		for num in range(1, n + 1):
			row = ''
			for x in range(0, num):
				row += str(num)
			result += row
			if num < n:
				result += '\n'
			else:
				pass
	return result


def pattern(n):
	d = []
	for i in range(n):
		counter = i + 1
		d.append(counter * str(counter))
	return '\n'.join(d)


def pattern(n):
	if n < 1:
		return ''
	pattern = '1'
	for i in range(2, n + 1):
		pattern += '\n' + str(i) * i
	return pattern


def pattern(n):
	if n <= 0:
		return ''
	res = '1'
	for i in range(2, n + 1):
		add = '\n{}'.format(str(i) * int(i))
		res += add
	return '1' if n == 1 else res


def pattern(n):
	if n < 0:
		return ''
	ans = []
	pattern = []
	count = n
	while n > 0:
		n = str(n)
		pattern.append(n)
		if len(pattern) == int(n):
			ans.insert(0, ''.join(pattern))
			n = int(n)
			n -= 1
			pattern = []
		n = int(n)
	return '\n'.join(ans)


def pattern(n):
	x = ''
	for i in range(1, n + 1):
		x += str(i) * i + '\n'
	print(x)
	return x.strip()


def pattern(n):
	print(n)
	if n <= 0:
		return ''
	s = '1'
	for i in range(2, n + 1):
		s += '\n' + i * str(i)
	return s


def pattern(n):
	if n == 1:
		return '1'
	if n < 1:
		return ''
	res = ''
	for i in range(0, n + 1, 1):
		res += str(i) * i + '\n'
	return ''.join(res.strip())


def pattern(n):
	if n < 1:
		return ''
	return '\n'.join((elem * str(elem) for elem in range(1, n + 1)))


def pattern(n):
	if n <= 0:
		return ''
	elif n == 1:
		return '1'
	else:
		ls = ['1']
		for i in range(2, n + 1):
			ls.append('\n' + f'{i}' * i)
		return ''.join(ls)


def pattern(n):
	return '\n'.join((str(d) * d for d in range(1, n + 1)))


def pattern(n):
	strx = ''
	for x in range(1, n + 1):
		strx += str(x) * x + '\n'
	return strx[:-1]


def pattern(n):
	if n < 1:
		return ''
	elif n == 1:
		return '1'
	return '\n'.join([x * f'{x}' for x in range(1, n + 1)])


def pattern(n):
	if n < 1:
		return ''
	else:
		s = ''
		for i in range(1, n + 1):
			s += str(i) * i + '\n'
		return s[:len(s) - 1]


def pattern(n):
	s = ''
	for i in range(1, n + 1):
		s += ''.join([str(i) for _ in range(i)])
		s += '\n'
	return s[:-1]


def pattern(n):
	l = []
	for i in range(1, n + 1):
		for j in range(1, i + 1):
			l.append(str(i))
		l.append('\n')
	st = ''.join(l)
	return st[:-1]


def pattern(n):
	my_list = []
	if n < 1:
		return ''
	for i in range(n):
		if i + 1 > 1:
			my_list.append('\n')
		for j in range(i + 1):
			my_list.append(str(i + 1))
	return ''.join(my_list)


def pattern(n):
	pattern = ''
	for i in range(1, n + 1):
		for x in range(1, i + 1):
			pattern += str(i)
		if i + 1 != n + 1:
			pattern += str('\n')
	return pattern


def pattern(n):
	emptystring = ''
	for i in range(1, n + 1):
		if i == n:
			emptystring = emptystring + '{}'.format(str(i) * i)
		else:
			emptystring = emptystring + '{}'.format(str(i) * i) + '\n'
	return emptystring


def pattern(n):
	solution = ''
	if n < 1:
		return solution
	for i in range(1, n + 1):
		solution += f'{i}' * i
		solution += '\n'
	return solution[:-1]


def pattern(n):
	a = ''
	for x in range(1, n + 1):
		a = a + str(x) * x + '\n'
	return a.rstrip('\n')


def pattern(n):
	val = []
	result = ''
	if n < 1:
		return ''
	else:
		val.append(str(1))
		print(val)
		for num in range(2, n + 1):
			s = str(num) * num
			val.append('\n' + s)
	return result.join(val)


def pattern(n):
	st = ''
	for n in range(1, n + 1):
		st += str(n) * n + '\n'
	return st[:-1]


def pattern(n):
	z = ''
	for x in range(1, n + 1):
		i = 0
		while i < x:
			z = z + str(x)
			i = i + 1
		if x != n:
			z = z + '\n'
	return z


def pattern(n):
	pattern_string = ''
	for i in range(1, n + 1):
		for k in range(0, i):
			pattern_string = pattern_string + str(i)
		if i != n:
			pattern_string = pattern_string + '\n'
	return pattern_string


def pattern(n):
	str2 = ''
	for i in range(1, n + 1):
		str2 += '{}\n'.format(str(i) * i)
	str2 = str2[:-1]
	return str2


def pattern(n):
	char = 1
	nTimes = 1
	string = ''
	while nTimes <= n:
		for i in range(0, nTimes):
			string += str(char)
		string += '\n'
		nTimes += 1
		char += 1
	return string[0:len(string) - 1]


def pattern(n):
	return '\n'.join([str(index + 1) * (index + 1) for index in range(n)])


def pattern(n):
	output = ''
	for x in range(1, n + 1):
		for y in range(1, x + 1):
			output += str(x)
		output += '\n'
	output = output[:len(output) - 1]
	return output