Given a list of characters, merge all of them into a string.
Example 1:
Input:
N = 13
Char array = g e e k s f o r g e e k s
Output: geeksforgeeks 
Explanation: combined all the characters
to form a single string.
Example 2:
Input:
N = 4
Char array = e e b a
Output: eeba
Explanation: combined all the characters
to form a single string.
Your Task:
You dont need to read input or print anything. Complete the function chartostr() which accepts a char array arr and its size  N  as parameter and returns a string.
 
Expected Time Complexity: O(N)
Expected Auxiliary Space: O(N)

Source: geeksforgeeks | Difficulty: EASY
Tags: String algorithms

Data structures

Starter code: #User function Template for python3

class Solution:
    def chartostr(self, arr,N):
        # code here

Solutions:
class Solution:

	def chartostr(self, arr, N):
		str = ''
		for i in arr:
			str = str + i
		return str


class Solution:

	def chartostr(self, arr, N):
		return ''.join(arr)


class Solution:

	def chartostr(self, arr, N):
		arr = list(map(str, arr))
		arr = ''.join(arr)
		return arr


class Solution:

	def chartostr(self, arr, N):
		result = ''
		for i in range(N):
			result += arr[i]
		return result


class Solution:

	def chartostr(self, arr, N):
		s = ''
		for i in arr:
			s += i
		return s


class Solution:

	def chartostr(self, arr, N):
		res = ''
		for i in arr:
			res += i
		return res


class Solution:

	def chartostr(self, arr, N):
		a = ''
		for i in arr:
			a += i
		return a


class Solution:

	def chartostr(self, arr, N):
		a = ''
		for i in arr:
			if i == ' ':
				continue
			else:
				a += i
		return a


class Solution:

	def chartostr(self, arr, N):
		s = ''
		for n in arr:
			s += n
		return s


class Solution:

	def chartostr(self, arr, N):
		l = list(arr)
		return ''.join(l)


class Solution:

	def chartostr(self, arr, N):
		sum = ''
		for a in arr:
			sum = sum + a
		return sum


class Solution:

	def chartostr(self, arr, n):
		return ''.join(arr)


class Solution:

	def chartostr(self, arr, N):
		word = ''
		for i in range(0, N):
			word = word + arr[i]
		return word


class Solution:

	def chartostr(self, arr, N):
		string = ''
		for i in arr:
			string += i
		return string


class Solution:

	def chartostr(self, arr, N):
		ans = ''
		for i in arr:
			ans += i
		return ans


class Solution:

	def chartostr(self, arr, N):
		return ''.join([elm for elm in arr])


class Solution:

	def chartostr(self, arr, N):
		str_out = ''
		for element in arr:
			str_out += element
		return str_out


class Solution:

	def chartostr(self, arr, N):
		str = ''
		for char in arr:
			str = str + char
		return str


class Solution:

	def chartostr(self, arr, N):
		s = ''
		for c in arr:
			s += c
		return s


class Solution:

	def chartostr(self, arr, N):
		com_str = ''
		for i in arr:
			com_str = com_str + i
		return com_str


class Solution:

	def chartostr(self, arr, N):
		return ''.join([x for x in arr])


class Solution:

	def chartostr(self, arr, N):
		for e in range(N):
			if arr[e] == ' ':
				arr[e] = ''
		arr = ''.join(arr)
		return arr


class Solution:

	def chartostr(self, arr, N):
		g = ''.join(arr)
		d = g.replace(' ', '')
		return d


class Solution:

	def chartostr(self, arr, N):
		myStr = ''
		for i in arr:
			myStr += i
		return myStr


class Solution:

	def chartostr(self, arr, N):
		a = ' '
		b = ''
		for value in arr:
			if value != a:
				b = b + value
		return b


class Solution:

	def chartostr(self, arr, N):
		temp_list = ''
		for i in arr:
			temp_list += i
		return temp_list


class Solution:

	def chartostr(self, arr, N):
		output = ''
		for i in arr:
			output += i
		return output


class Solution:

	def chartostr(self, arr, N):
		new_Str = ''
		for i in arr:
			new_Str += i
		return new_Str


class Solution:

	def chartostr(self, arr, N):
		c = ''
		for i in arr:
			c += i
		return c


class Solution:

	def chartostr(self, arr, N):
		n = ''
		for i in arr:
			n = n + i
		return n