You are given an array arr of size N. You need to push the elements of the array into a stack and then print them while popping. 
Example 1: 
Input:
n = 5
arr = {1 2 3 4 5}
Output:
5 4 3 2 1
Example 2: 
Input: 
n = 7
arr = {1 6 43 1 2 0 5}
Output: 
5 0 2 1 43 6 1
 
Your Task:
Since this is a function problem, you don't need to take any input. Just complete the provided functions _push() and _pop().
Constraints:
1 <= A_{i} <= 10^{7}

Source: geeksforgeeks | Difficulty: EASY
Tags: Data structures

Starter code: #User function Template for python3



#_push function to insert elements of array to stack

def _push(arr):

    #return a stack with all elements of arr inserted in it

    

    



#_pop function to print elements of the stack remove as well

def _pop(stack):

    #print top and pop for each element until it becomes empty





Solutions:
def _push(arr):
	stack = []
	for i in range(len(arr)):
		stack.append(arr[i])
	return stack

def _pop(stack):
	while len(stack) > 0:
		print(stack.pop(), end=' ')


def _push(arr):
	a = []
	for i in arr:
		a.append(i)
	return a

def _pop(stack):
	for i in range(len(stack) - 1, -1, -1):
		print(stack.pop(i), end=' ')


def _push(arr):
	stack = []
	for i in range(n):
		stack.append(arr[i])
	return stack

def _pop(stack):
	l = []
	for i in range(n):
		if len(stack) != 0:
			print(stack.pop(), end=' ')


def _push(arr):
	s = []
	for i in arr:
		s.append(i)
	return s

def _pop(stack):
	for j in range(len(stack)):
		print(stack.pop(), end=' ')


def _push(arr):
	return arr

def _pop(stack):
	while stack:
		print(stack.pop(), end=' ')


def _push(arr):
	return list(arr)

def _pop(stack):
	while stack:
		popped_item = stack.pop()
		print(popped_item, end=' ')


def _push(arr):
	li = []
	for i in arr:
		li.append(i)
	return li

def _pop(stack):
	while stack:
		a = stack.pop()
		print(a, end=' ')


def _push(arr):
	stack = []
	for i in arr:
		stack.append(i)
	return stack

def _pop(stack):
	while stack:
		print(stack[-1], end=' ')
		stack.pop()


def _push(arr):
	return arr

def _pop(stack):
	for _ in range(len(stack)):
		print(stack.pop(), end=' ')


def _push(arr):
	stack = []
	for i in arr:
		stack.append(i)
	return stack

def _pop(stack):
	for i in range(n):
		print(stack.pop(), end=' ')


def _push(arr):
	a = []
	for i in arr:
		a.append(i)
	return a

def _pop(stack):
	while len(stack) != 0:
		print(stack[-1], end=' ')
		stack.pop()


def _push(arr):
	stack = arr
	return stack

def _pop(stack):
	for i in stack[::-1]:
		print(i, end=' ')


from queue import LifoQueue

def _push(arr):
	stack = LifoQueue(maxsize=len(arr))
	while not len(arr) == 0:
		stack.put(arr.pop(0))
	return stack

def _pop(stack):
	while not stack.empty():
		top = stack.get()
		print(top, end=' ')


def _push(arr):
	n = len(arr)
	st = []
	for i in range(n):
		st.append(arr[i])
	return st

def _pop(stack):
	while len(stack) > 0:
		el = stack[-1]
		print(el, end=' ')
		stack.pop()


def _push(arr):
	stack = arr[:]
	return stack

def _pop(stack):
	while len(stack) > 0:
		print(stack.pop(), end=' ')


def _push(arr):
	s = []
	for i in arr:
		s.append(i)
	return s

def _pop(stack):
	if stack is None:
		return
	else:
		while stack:
			e = stack.pop()
			print(e, end=' ')


def _push(arr):
	return arr[::-1]

def _pop(stack):
	print(*stack, end='')


def _push(arr):
	return arr

def _pop(stack):
	if len(stack) == 0:
		return
	print(stack.pop(), end=' ')
	_pop(stack)


stk = []

def _push(arr):
	for i in range(0, len(arr)):
		stk.append(arr[i])

def _pop(stack):
	for j in range(0, len(stk)):
		print(stk.pop(), end=' ')


def _push(arr):
	stack = []
	for num in arr:
		stack.append(num)
	return stack

def _pop(stack):
	while stack:
		print(stack.pop(), end=' ')


def _push(arr):
	stack = [0] * len(arr)
	top = -1
	for i in range(len(arr)):
		top += 1
		stack[top] = arr[top]
	return stack

def _pop(stack):
	top = len(stack) - 1
	while top > -1:
		print(stack[top], end=' ')
		top -= 1


def _push(arr):
	return arr

def _pop(stack):
	ans = []
	if len(stack) == 0:
		return ans
	while len(stack) > 0:
		x = stack.pop()
		ans.append(x)
		print(x, end=' ')
	return ans


def _push(arr):
	stack = []
	for i in arr:
		stack.append(i)
	return stack

def _pop(stack):
	while len(stack) is not 0:
		print(stack.pop(), end=' ')


def _push(arr):
	return [item for item in arr]

def _pop(stack):
	while stack:
		print(stack.pop(), end=' ')


from collections import deque

def _push(arr):
	s = deque()
	for i in arr:
		s.append(i)
	return s

def _pop(stack):
	while len(stack):
		print(stack.pop(), end=' ')


def _push(arr):
	stack = []
	for x in arr:
		stack.append(x)
	return stack

def _pop(stack):
	while len(stack) > 0:
		print(stack.pop(), end=' ')


def _push(arr):
	stk = []
	stk.extend(arr)
	return stk

def _pop(stack):
	for I in range(len(stack)):
		print(stack.pop(), end=' ')