Geek is very fond of patterns. Once, his teacher gave him a  pattern to solve. He gave Geek an integer n and asked him to build a pattern.
Help Geek to build a pattern.
 
Example 1:
Input: 5
Output:
*********
 *******
  *****
   ***
    *
Your Task:
You don't need to input anything. Complete the function printTriangle() which takes  an integer n  as the input parameter and print the pattern.
Constraints:
	1<= N <= 20

Source: geeksforgeeks | Difficulty: EASY

Starter code: #User function Template for python3



class Solution:

    def printTriangle(self, N):

        # Code here

Solutions:
class Solution:

	def printTriangle(self, N):
		for i in range(N):
			for j in range(i):
				print(' ', end='')
			for j in range(2 * N - (2 * i + 1)):
				print('*', end='')
			for j in range(i):
				print(' ', end='')
			print()


class Solution:

	def printTriangle(self, N):
		for i in range(N):
			for k in range(0, i):
				print(' ', end='')
			for j in range(0, 2 * N - (2 * i + 1)):
				print('*', end='')
			for k in range(0, i):
				print(' ', end='')
			print('', end='\n')


class Solution:

	def printTriangle(self, N):
		k = N
		while N >= 1:
			print((k - N) * ' ' + '*' * (2 * N - 1))
			N = N - 1


class Solution:

	def printTriangle(self, N):
		l = []
		count = 0
		for x in range(1, N * 5):
			if x % 2 != 0 and count < N:
				count += 1
				l.append(x)
		l.reverse()
		for x in l:
			print(' ' * ((l[0] - x) // 2) + '*' * x)


class Solution:

	def printTriangle(self, N):
		for i in range(N, 0, -1):
			print(' ' * (N - i) + '*' * (2 * i - 1))


class Solution:

	def printTriangle(self, N):
		tmp = 0
		for i in range(2 * N - 1, N - 1, -1):
			for j in range(1, i + 1):
				if j > tmp:
					print('*', end='')
				else:
					print(' ', end='')
			print()
			tmp += 1


class Solution:

	def printTriangle(self, N):
		i = 0
		while i < N:
			spaces = 0
			while spaces < i:
				print(' ', end='')
				spaces += 1
			stars = 0
			while stars < 2 * (N - i) - 1:
				print('*', end='')
				stars += 1
			print()
			i += 1


class Solution:

	def printTriangle(self, n):
		for i in range(1, n + 1):
			print(' ' * (i - 1) + '*' * (n * 2 - i * 2 + 1))


class Solution:

	def printTriangle(self, N):
		for row in range(N):
			for sp in range(row):
				print(' ', end='')
			for star in range(2 * (N - row - 1) + 1):
				print('*', end='')
			print()


class Solution:

	def printTriangle(self, N):
		(stars, space) = (N * 2 - 1, 0)
		for i in range(N):
			print(' ' * space, end='')
			print('*' * stars)
			stars -= 2
			space += 1


class Solution:

	def printTriangle(self, N):
		arr = list(range(1, N + 1))
		new_list = []
		for item in arr:
			p = 2 * item - 1
			new_list.append('*' * p)
		new_list.sort(reverse=True)
		for item in new_list:
			q = new_list.index(item)
			print(' ' * q + item)


class Solution:

	def printTriangle(self, n):
		for i in range(n):
			for j in range(i):
				print(' ', end='')
			for k in range(2 * (n - i) - 1):
				print('*', end='')
			for l in range(i):
				print(' ', end='')
			print()


class Solution:

	def printTriangle(self, N):
		no_of_star = 2 * N - 1
		for i in range(N):
			no_of_spaces = i
			print(' ' * no_of_spaces + '*' * no_of_star)
			no_of_star -= 2


class Solution:

	def printTriangle(self, N):
		x = N * 2 - 1
		k = 0
		for i in range(N):
			print(k * ' ', end='')
			print(x * '*', end='')
			k = k + 1
			x = x - 2
			print()


class Solution:

	def printTriangle(self, N):
		a = 2 * N - 1
		for i in range(1, N + 1):
			for y in range(i - 1):
				print(' ', end='')
			for x in range(a + (i - 1) * -2):
				print('*', end='')
			print()
		return