### Task:

You have to write a function `pattern` which creates the following pattern (See Examples) upto desired number of rows.

If the Argument is `0` or a Negative Integer then it should return `""` i.e. empty string.

### Examples:

`pattern(9)`:

    123456789
    234567891
    345678912
    456789123
    567891234
    678912345
    789123456
    891234567
    912345678

`pattern(5)`:

    12345
    23451
    34512
    45123
    51234

Note: There are no spaces in the pattern

Hint: Use `\n` in string to jump to next line

Source: codewars | Difficulty: EASY
Tags: String algorithms

Fundamentals

Starter code: def pattern(n):
	

Solutions:
def pattern(n):
	return '\n'.join((''.join((str((x + y) % n + 1) for y in range(n))) for x in range(n)))


def pattern(n):
	nums = list(range(1, n + 1))
	result = ''
	result += ''.join((str(n) for n in nums))
	for i in range(1, n):
		result += '\n'
		nums.append(nums.pop(0))
		result += ''.join((str(n) for n in nums))
	return result


from collections import deque

def pattern(n):
	result = []
	line = deque([str(num) for num in range(1, n + 1)])
	for i in range(n):
		result.append(''.join(line))
		line.rotate(-1)
	return '\n'.join(result)


from collections import deque

def pattern(n):
	A = deque([str(i + 1) for i in range(n)])
	result = []
	for i in range(len(A)):
		print(A)
		result.append(''.join(A))
		A.rotate(-1)
	return '\n'.join(result)


def pattern(s):
	return '\n'.join([''.join((str(x + y) if x + y <= s else str(x + y - s * ((x + y) // s)) for y in range(s))) for x in range(1, s + 1)])


from itertools import chain

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


from itertools import chain

def pattern(n):
	xs = ''.join((str(i) for i in range(1, n + 1)))
	return '\n'.join((''.join((str(j) for j in chain(range(i, n + 1), range(1, i)))) for i in range(1, n + 1)))


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