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:
1 2 3 4 5
1 2 3 4
1 2 3 
1 2  
1 
 
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(N - i):
				print(j + 1, '', end='')
			print()


class Solution:

	def printTriangle(self, N):
		for x in range(N, 0, -1):
			for y in range(1, x + 1):
				if y == x:
					print(x)
					break
				print(y, end=' ')


class Solution:

	def printTriangle(self, N):
		num = N
		while num > 0:
			for i in range(num):
				print(i + 1, end=' ')
			print()
			num = num - 1


class Solution:

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


class Solution:

	def printTriangle(self, N):
		i = 0
		while i < N:
			j = 1
			while j <= N - i:
				print(j, end=' ')
				j += 1
			print()
			i += 1


class Solution:

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


class Solution:

	def printTriangle(self, N):
		for i in range(N, 0, -1):
			print(' '.join(['{}'.format(j) for j in range(1, i + 1)]))


class Solution:

	def printTriangle(self, N):
		for roe in range(N):
			for col in range(N - roe):
				print(col + 1, end=' ')
			print()


class Solution:

	def printTriangle(self, N):
		a = ''
		for i in range(1, N + 1):
			a = a + str(i) + ' '
		b = len(a)
		c = ''
		d = 0
		for i in range(N, 0, -1):
			c = c + str(i) + ' '
			print(a[:b - d])
			d = len(c)


class Solution:

	def printTriangle(self, N):
		l = range(1, N + 1)
		for i in range(N):
			print(*l[:N - i], sep=' ')


class Solution:

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


class Solution:

	def printTriangle(self, N):
		arr = list(range(1, N + 1))
		n = len(arr)
		for i in range(1, N + 1):
			print(*arr[0:N + 1 - i])