Given an array Arr of size N, print all its elements.
Example 1:
Input:
N = 5
Arr[] = {1, 2, 3, 4, 5}
Output: 1 2 3 4 5
Example 2:
Input:
N = 4
Arr[] = {2, 3, 5, 5}
Output: 2 3 5 5
Your Task:
Complete the function printArray() which takes an array arr, single integer n, as input parameters and prints the value of the array space separated.
Expected Time Complexity: O(N)
Expected Auxiliary Space: O(1)
Constraints:
1 <= N <= 10^{5}
1 <= Arr[i] <= 10^{5}

Source: geeksforgeeks | Difficulty: EASY
Tags: Data structures

Starter code: #User function Template for python3

class Solution:

    # Just print the space seperated array elements

	def printArray(self,arr, n):

	    # code here

Solutions:
class Solution:

	def printArray(self, arr, n):
		for i in arr:
			print(i, end=' ')


class Solution:

	def printArray(self, arr, n):
		for c in arr:
			print(c, end=' ')


class Solution:

	def printArray(self, arr, n):
		for each in arr:
			print(each, end=' ')


class Solution:

	def printArray(self, arr, n):
		for num in arr:
			print(num, end=' ')


class Solution:

	def printArray(self, arr, n):
		for x in arr:
			print(x, end=' ')


class Solution:

	def printArray(self, arr, n):
		for a in arr:
			print(a, end=' ')


class Solution:

	def printArray(self, arr, n):
		for i in range(0, len(arr)):
			print(arr[i], end=' ')


class Solution:

	def printArray(self, arr, n):
		for val in arr:
			print(val, end=' ')


class Solution:

	def printArray(self, arr, n):
		for data in arr:
			print(data, end=' ')


class Solution:

	def printArray(self, arr, n):
		for ele in arr:
			print(ele, end=' ')


class Solution:

	def printArray(self, arr, n):
		self.arr = arr
		self.n = n
		for i in range(self.n):
			if 1 <= self.arr[i] <= 100000 and 1 <= self.n <= 100000:
				print(self.arr[i], end=' ')


class Solution:

	def printArray(self, arr, n):
		print(' '.join(map(str, arr)), end='')