For a given number N. Print the pattern in the following form: 1 121 12321 1234321 for N = 4.
Example 1:
Input:
N = 3
Output:
1 121 12321
Explanation:
For N = 3 we will print the 3 strings 
according to the pattern.
Example 2:
Input:
N = 6
Output:
1 121 12321 1234321 123454321 12345654321
Explanation:
For N = 6 we will print the 6 strings 
according to the pattern.
Your Task:  
You don't need to read input or print anything. Your task is to complete the function numberPattern() which takes an integer N as input parameter and returns the list of strings to be printed.
Expected Time Complexity: O(N^{2})
Expected Auxiliary Space: O(1)
Constraints:
1 ≤ N ≤ 200

Difficulty: EASY
Expected Time Complexity: O(N^{2})
Expected Auxiliary Space: O(1)

Starter code:
#User function Template for python3
class Solution:
	def numberPattern(self, N):
		# code here

Solutions:
class Solution:

	def numberPattern(self, N):
		l = []
		val = 1
		val1 = 0
		for i in range(N):
			s = ''
			for j in range(1, val + 1):
				s += str(j)
			for j in range(val1, 0, -1):
				s += str(j)
			l.append(s)
			val += 1
			val1 += 1
		return l


class Solution:

	def numberPattern(self, N):
		res = []
		for i in range(N):
			entry = '1'
			int_entry = 1
			for j in range(0, i):
				entry = entry + str(int_entry + 1)
				int_entry = int_entry + 1
			for j in range(0, i):
				entry = entry + str(int_entry - 1)
				int_entry = int_entry - 1
			res.append(entry)
		return res


class Solution:

	def numberPattern(self, N):
		m = []
		for i in range(1, N + 1):
			new = []
		for j in range(1, i + 1):
			new.append(str(j))
			m.append(''.join(new + new[-2::-1]))
		return m


class Solution:

	def numberPattern(self, N):
		result = []
		for i in range(1, N + 1):
			ans = ''
			for j in range(1, i + 1):
				ans += str(j)
			for k in range(i - 1, 0, -1):
				ans += str(k)
			result.append(ans)
		return result


class Solution:

	def numberPattern(self, N):
		l = []
		for i in range(1, N + 1):
			temp = []
			for j in range(1, i + 1):
				temp.append(str(j))
			for k in range(i - 1, 0, -1):
				temp.append(str(k))
			l.append(''.join(temp))
		return l


class Solution:

	def numberPattern(self, n):
		l = []
		for i in range(1, n + 1):
			s = ''
			for j in range(1, i + 1):
				s = s + str(j)
			for j in range(i - 2, -1, -1):
				s = s + str(j + 1)
			l.append(s)
		return l


class Solution:

	def numberPattern(self, N):
		a = ''
		a1 = []
		for i in range(1, N + 1):
			for j in range(1, i + 1):
				a += str(j)
			for j in range(i - 1, 0, -1):
				a += str(j)
			a1.append(int(a))
			a = ''
		return a1


class Solution:

	def numberPattern(self, N):
		res = []
		for i in range(1, N + 1):
			step = []
			for j in range(1, i + 1):
				step.append(str(j))
			n = len(step)
			for k in range(n - 2, -1, -1):
				step.append(str(step[k]))
			res.append(''.join(step))
		return res


class Solution:

	def numberPattern(self, N):
		lst = []
		for i in range(1, N + 1):
			ans = ''
			for j in range(1, i + 1, 1):
				ans += str(j)
			while i > 0:
				i = i - 1
				if i > 0:
					ans += str(i)
			lst.append(ans)
		return lst


class Solution:

	def numberPattern(self, N):
		ln = []
		for i in range(N + 1):
			res = ''
			for i in range(1, i + 1):
				res += str(i)
			for i in range(i - 1, 0, -1):
				res += str(i)
			ln.append(res)
		return ln[1:]


class Solution:

	def numberPattern(self, N):
		res = []
		for i in range(1, N + 1):
			s = ''
			for j in range(1, i + 1):
				s += str(j)
			for j in range(i + 1, 2 * i):
				s += str(2 * i - j)
			res.append(s)
		return res


class Solution:

	def numberPattern(self, N):
		str1 = []
		for i in range(0, N):
			num = 0
			for j in range(0, i + 1):
				if j < 10:
					num = num * 10 + j
				elif j < 100:
					num = num * 100 + j
				elif j <= 200:
					num = num * 1000 + j
			for j in range(i + 1, 0, -1):
				if j < 10:
					num = num * 10 + j
				elif j < 100:
					num = num * 100 + j
				elif j <= 200:
					num = num * 1000 + j
			str1.append(str(num))
		return str1


class Solution:

	def numberPattern(self, N):
		k = []
		i = 1
		while i <= N:
			l = []
			j = list(range(1, i + 1))
			l[:] = j[:]
			l.pop(-1)
			l.reverse()
			l = j + l
			st = ''
			for h in range(len(l)):
				st = st + str(l[h])
			k.append(st)
			i = i + 1
		return k


class Solution:

	def numberPattern(self, N):
		sp = N - 1
		li = []
		st = 1
		for i in range(1, N + 1):
			t = 1
			s = ''
			for j in range(1, st + 1):
				s = s + str(t)
				if j >= i:
					t = t - 1
				else:
					t = t + 1
			sp = sp - 1
			st = st + 2
			li.append(s)
		return li


class Solution:

	def numberPattern(self, N):
		r = []
		for i in range(N):
			s = ''
			for j in range(i + 1):
				s += str(j)
			for j in range(i + 1, 0, -1):
				s += str(j)
			r.append(int(s))
		return r


class Solution:

	def numberPattern(self, N):
		list = []
		for i in range(0, N):
			string = ''
			for j in range(1, i + 2):
				string += str(j)
			for j in range(i, 0, -1):
				string += str(j)
			list.append(string)
		return list


class Solution:

	def numberPattern(self, N):
		lis = []
		for i in range(1, N + 1):
			out = ''
			for j in range(1, i + 1):
				out += str(j)
			for j in range(i - 1, 0, -1):
				out += str(j)
			lis.append(out)
		return lis


class Solution:

	def numberPattern(self, N):
		newstr = ''
		lst = []
		for i in range(1, N + 1):
			for j in range(1, i + 1):
				newstr += str(j)
			for k in range(i, 1, -1):
				newstr += str(k - 1)
			lst.append(newstr)
			newstr = ''
		return lst


class Solution:

	def numberPattern(self, N):
		n = N
		a = []
		b = []
		c = ''
		for i in range(1, n + 1):
			for j in range(1, i + 1):
				a.append(j)
			a = a + a[-2::-1]
			c = ''.join([str(elem) for elem in a])
			b.append(c)
			a.clear()
			c = c[0:0]
		return b


class Solution:

	def numberPattern(self, n):
		re = []
		for i in range(1, n + 1):
			str1 = ''
			for j in range(1, i + 1):
				str1 = str1 + str(j)
			for k in range(i - 1, 0, -1):
				str1 = str1 + str(k)
			re.append(str1)
		return re


class Solution:

	def numberPattern(self, N):
		sol = []
		for i in range(1, N + 1):
			l = []
			cnt = 1
			rever = False
			for j in range(2 * i - 1):
				l.append(str(cnt))
				if cnt < i and rever == False:
					cnt += 1
				else:
					cnt -= 1
					rever = True
			tem = ''.join(l)
			sol += [str(tem)]
		return sol


class Solution:

	def numberPattern(self, N):
		res = []
		for i in range(1, N + 1):
			st = ''
			for j in range(1, i + 1):
				st += str(j)
			for v in range(j - 1, 0, -1):
				st += str(v)
			res.append(int(st))
		return res


class Solution:

	def numberPattern(self, N):
		l = []
		for i in range(1, N + 1):
			s = ''
			for j in range(1, i + 1):
				s += str(j)
			for j in range(i - 1, 0, -1):
				s += str(j)
			l.insert(len(l), s)
		return l


class Solution:

	def numberPattern(self, N):
		a = []
		for i in range(1, N + 1):
			b = []
			for j in range(1, i + 1):
				b.append(str(j))
			a.append(''.join(b + b[-2::-1]))
		return a


class Solution:

	def numberPattern(self, N):
		result = ['1']
		temp = [1]
		for i in range(2, N + 1):
			temp.append(i)
			x = [str(ele) for ele in temp]
			result.append(''.join(x) + ''.join(x[::-1][1:]))
		return result


class Solution:

	def numberPattern(self, N):
		l = []
		for j in range(1, N + 1):
			s = []
			mid = j
			for i in range(1, j):
				s.insert(i - 1, str(i))
				s.insert(i, str(i))
			s.insert(len(s) // 2, str(j))
			st = ''
			for i in s:
				st += i
			l.append(st)
		return l


class Solution:

	def numberPattern(self, N):
		m = []
		for i in range(1, N + 1):
			s = ''
			for i in range(1, i + 1):
				s += str(i)
			for k in range(i, 1, -1):
				s += str(k - 1)
			m.append(s)
		return m


class Solution:

	def numberPattern(self, n):
		a = []
		for i in range(0, n):
			x = ''
			for j in range(0, i + 1):
				x += str(j + 1)
			for j in range(i, 0, -1):
				x += str(j)
			a.append(x)
		return a


class Solution:

	def numberPattern(self, N):
		lst = []
		for row in range(N):
			x = ''
			for col in range(row + 1):
				x += str(col + 1)
			for col in range(row, 0, -1):
				x += str(col)
			lst.append(x)
		return lst


class Solution:

	def numberPattern(self, N):
		c = 0
		l = []
		while N:
			c += 1
			s = ''
			e = 1
			while e <= c:
				s += str(e)
				d = e
				e += 1
			d = d - 1
			while d:
				s += str(d)
				d -= 1
			l.append(s)
			N -= 1
		return l


class Solution:

	def numberPattern(self, N):
		f = []
		fs = ''
		for i in range(1, N + 1):
			s = []
			for j in range(1, i + 1):
				s.append(str(j))
			for j in range(len(s) - 1, 0, -1):
				s.append(str(j))
			fs = ''.join(s)
			f.append(fs)
		return f
		return f


class Solution:

	def numberPattern(self, N):
		lst = [0] * N
		for i in range(1, N + 1):
			s = ''
			for j in range(1, i + 1):
				s += str(j)
			for j in range(i - 1, 0, -1):
				s += str(j)
			lst[i - 1] = s
		return lst


from math import log10

class Solution:

	def numberPattern(self, N):
		res = [1]
		for i in range(2, N + 1):
			s = 1
			for j in range(2, i):
				s = s * 10 ** (int(log10(j)) + 1) + j
			for j in range(i, 0, -1):
				s = s * 10 ** (int(log10(j)) + 1) + j
			res.append(s)
		return res


class Solution:

	def numberPattern(self, n):
		l = []
		for i in range(1, n + 1):
			p = ''
			for j in range(1, i + 1):
				p = p + str(j)
			for j in range(i - 1, 0, -1):
				p = p + str(j)
			l.append(p)
		return l


class Solution:

	def numberPattern(self, N):
		ans = []
		for x in range(1, N + 1):
			ans.append(''.join(map(str, [*range(1, x + 1), *range(1, x + 1)[::-1][1:]])))
		return ans


class Solution:

	def numberPattern(self, N):
		list = []
		for x in range(1, N + 1):
			s = ''
			for y in range(1, x):
				s += str(y)
			for y in range(x):
				s += str(x - y)
			list.append(s)
		return list


class Solution:

	def numberPattern(self, N):
		pattern = []
		for i in range(1, N + 1):
			txt = ''
			for j in range(1, i + 1):
				txt += str(j)
			else:
				for k in range(j - 1, 0, -1):
					txt += str(k)
			pattern.append(txt)
		return pattern


class Solution:

	def numberPattern(self, N):
		r = []
		for i in range(1, N + 1):
			j = 1
			s = ''
			temp = i
			while j <= 2 * i - 1:
				if j <= i:
					s += str(j)
					j += 1
				else:
					temp -= 1
					s += str(temp)
					j += 1
			r.append(s)
		return r


class Solution:

	def numberPattern(self, N):
		self.m = []
		self.c = ''
		for i in range(1, N + 1):
			for j in range(1, i + 1):
				self.c += str(j)
			for j in range(i - 1, 0, -1):
				self.c += str(j)
			self.m.append(self.c)
			self.c = ''
		return self.m


class Solution:

	def numberPattern(self, N):
		ans = []
		for a in range(1, N + 1):
			x = ''
			for i in range(1, a + 1):
				x += str(i)
			for h in range(a - 1, 0, -1):
				x += str(h)
			ans.append(x)
		return ans


class Solution:

	def numberPattern(self, N):
		lst = []
		for i in range(1, N + 1):
			temp = []
			for j in range(1, i + 1):
				temp.append(str(j))
			lst.append(''.join(temp + temp[-2::-1]))
		return lst


class Solution:

	def numberPattern(self, N: int) -> list:
		numbers = []
		for i in range(1, N + 1):
			if i == 1:
				numbers.append('1')
			else:
				number = ''
				for j in range(1, i):
					number += str(j)
				for j in range(i, 0, -1):
					number += str(j)
				numbers.append(number)
		return numbers


class Solution:

	def numberPattern(self, N):
		l = []
		for i in range(1, N + 1):
			a = ''
			b = ''
			for j in range(1, i + 1):
				a = a + str(j)
			for k in range(i - 1, 0, -1):
				b = b + str(k)
			l.append(a + b)
		return l


class Solution:

	def numberPattern(self, N):
		l = []
		for i in range(1, N + 1):
			output = ''
			for j in range(1, i + 1):
				output += str(j)
			for j in range(i - 1, 0, -1):
				output += str(j)
			l.append(output)
		return l


class Solution:

	def numberPattern(self, N):
		k = []
		for i in range(1, N + 1):
			c = ''
			for j in range(1, i + 1):
				c += str(j)
			for b in reversed(range(1, j)):
				c += str(b)
			k.append(int(c))
		return k


class Solution:

	def numberPattern(self, N):
		res = []
		for i in range(1, N + 1):
			temp = ''
			j = 0
			while j < i:
				temp += str(j + 1)
				j += 1
			while j > 1:
				temp += str(j - 1)
				j -= 1
			res.append(temp)
		return res


class Solution:

	def numberPattern(self, N):
		str_needed = ['' * k for k in range(N)]
		for i in range(1, N + 1):
			reverse_str = ''
			for j in range(1, i):
				str_needed[i - 1] += str(j)
				reverse_str += str(i - j)
			str_needed[i - 1] = str_needed[i - 1] + str(i) + reverse_str
			del reverse_str
		return str_needed