Given an integer N which has odd number of digits, find whether the given number is a balanced or not. 
An odd digit number is called a balanced number if the sum of all digits to the left of the middle digit and the sum of all digits to the right of the middle digit is equal.
Example 1:
Input:
N = 1234006
Output: 1 
Explanation: Total number of digits in
N = 7. Middle digit is 4. LHS = 1+2+3 = 6
and RHS = 0+0+6 = 6. LHS is equal to RHS. 
Example 2:
Input:
N = 12345
Output: 0
Explanation: LHS = 1+2 = 3 and RHS = 4+5
= 9. LHS and RHS are not equal.
Your Task:  
You dont need to read input or print anything. Complete the function balancedNumber() which takes string N as input parameter and returns a boolean value denoting if N is balanced or not.
Note: The driver code prints 1 if the returned value is true otherwise 0
Expected Time Complexity: O(number of digits in N)
Expected Auxiliary Space: O(1)
Constraints:
1<= N <= 10^{100}
N will always have odd number of digits.
Since N can be very large, it is given as a string.

Source: geeksforgeeks | Difficulty: EASY
Tags: String algorithms

Data structures

Mathematics

Starter code: #User function Template for python3
class Solution:
	def balancedNumber(self, N):
		# your code here

Solutions:
class Solution:

	def balancedNumber(self, N):
		l = []
		sum1 = 0
		sum2 = 0
		str1 = str(N)
		for i in str1:
			l.append(i)
		mid_elme = len(l) // 2
		l.remove(l[mid_elme])
		for i in range(0, len(l) // 2):
			sum1 = sum1 + int(l[i])
		for i in range(len(l) // 2, len(l)):
			sum2 = sum2 + int(l[i])
		if sum1 == sum2:
			return 1
		else:
			return 0


class Solution:

	def balancedNumber(self, n):
		num = str(n)
		leng = len(num)
		lh = num[:leng // 2]
		rh = num[leng // 2 + 1:]
		ls = 0
		rs = 0
		for i in lh:
			ls += int(i)
		for i in rh:
			rs += int(i)
		if ls == rs:
			return 1
		else:
			return 0


class Solution:

	def balancedNumber(self, N):
		a1 = list(N)
		a2 = len(a1) // 2
		m1 = a1[0:a2]
		m2 = a1[a2 + 1:]
		s = 0
		s1 = 0
		for i in m1:
			s = s + int(i)
		for i in m2:
			s1 = s1 + int(i)
		if s == s1:
			return True
		else:
			return False


class Solution:

	def balancedNumber(self, N):
		s = str(N)
		n = len(s)
		s1 = 0
		for i in range(n // 2):
			s1 += int(s[i])
		s2 = 0
		for i in range(n // 2 + 1, n):
			s2 += int(s[i])
		return int(s1 == s2)


class Solution:

	def balancedNumber(self, N):
		mid = int(len(N) / 2)
		first = N[0:mid]
		last = N[mid + 1:len(N)]
		sum1 = 0
		sum2 = 0
		for i in first:
			sum1 += int(i)
		for j in last:
			sum2 += int(j)
		if sum1 == sum2:
			return 1
		return 0


class Solution:

	def balancedNumber(self, n):
		l = len(n)
		s1 = n[:l // 2]
		s2 = n[l // 2 + 1:]
		sum1 = 0
		sum2 = 0
		for i in s1:
			sum1 += int(i)
		for i in s2:
			sum2 += int(i)
		if sum1 == sum2:
			return True
		else:
			return False


class Solution:

	def balancedNumber(self, N):
		N = str(N)
		mid = len(str(N)) // 2
		left = sum((int(i) for i in N[:mid]))
		right = sum((int(i) for i in N[mid + 1:]))
		if left == right:
			return 1
		return 0


class Solution:

	def balancedNumber(self, N):
		v = str(N)
		x = len(v) // 2
		c = 0
		d = 0
		for i in range(0, x):
			c += int(N[i])
		for i in range(x + 1, len(v)):
			d += int(N[i])
		return c == d


class Solution:

	def balancedNumber(self, n):
		n = str(n)
		m = len(n) // 2
		s = 0
		p = 0
		for i in range(0, m):
			s += int(n[i])
		for j in range(m + 1, len(n)):
			p += int(n[j])
		if p == s:
			return 1
		return 0


class Solution:

	def balancedNumber(self, N):
		a = len(N)
		a1 = N[:a // 2]
		a2 = N[a // 2 + 1:]
		sum1 = 0
		sum2 = 0
		for i in a1:
			sum1 += int(i)
		for i in a2:
			sum2 += int(i)
		if sum1 == sum2:
			return True
		else:
			return False


class Solution:

	def balancedNumber(self, N):
		x = len(N) // 2
		c = 0
		d = 0
		for i in range(0, x):
			c += int(N[i])
		for i in range(x + 1, len(N)):
			d += int(N[i])
		if c == d:
			return 1
		else:
			return 0


class Solution:

	def balancedNumber(self, N):
		s = str(N)
		a = []
		for i in range(len(s)):
			a.append(int(s[i]))
		if len(s) % 2 != 0:
			k = len(s) // 2
			if sum(a[:k]) == sum(a[k + 1:]):
				return 1
			return 0
		else:
			k = len(s) // 2
			if sum(a[:k]) == sum(a[k:]):
				return 1
			return 0


class Solution:

	def balancedNumber(self, N):
		n = len(N)
		l1 = N[0:n // 2]
		l2 = N[n // 2 + 1:n]
		s1 = 0
		s2 = 0
		for i in l1:
			s1 += int(i)
		for j in l2:
			s2 += int(j)
		if s1 == s2:
			return 1
		else:
			return 0


class Solution:

	def balancedNumber(self, n):
		s = str(n)
		a = 0
		b = 0
		m = len(s) // 2
		for i in range(len(s)):
			if i < m:
				a += int(s[i])
			if i > m:
				b += int(s[i])
		if a == b:
			return 1
		return 0


class Solution:

	def balancedNumber(self, N):
		leftsum = 0
		rightsum = 0
		for i in range(0, int(len(N) / 2)):
			leftsum = leftsum + int(N[i])
			rightsum = rightsum + int(N[len(N) - 1 - i])
		if leftsum == rightsum:
			return 1
		else:
			return 0


class Solution:

	def balancedNumber(self, N):
		l = [int(i) for i in str(N)]
		m = len(l) // 2
		if sum(l[:m]) == sum(l[m + 1:]):
			return 1
		return 0


class Solution:

	def balancedNumber(self, N):
		k = len(N) // 2
		left = 0
		right = 0
		i = 0
		j = len(N) - 1
		while i < j:
			left += int(N[i])
			right += int(N[j])
			i += 1
			j -= 1
		if left == right:
			return 1
		return 0


class Solution:

	def balancedNumber(self, N):
		n = len(N) // 2
		left = sum(list(map(int, list(N[:n]))))
		right = sum(list(map(int, list(N[-n:]))))
		return int(left == right) if n > 0 else 1


class Solution:

	def balancedNumber(self, n):
		l = len(n)
		s1 = n[:l // 2]
		s2 = n[l // 2 + 1:]
		sum1 = 0
		sum2 = 0
		for i in s1:
			sum1 += int(i)
		for i in s2:
			sum2 += int(i)
		return sum1 == sum2


class Solution:

	def balancedNumber(self, N):
		l = len(N) // 2
		N = str(N)
		a = N[:l]
		b = N[l + 1:]
		s1 = 0
		s2 = 0
		for i in a:
			s1 += int(i)
		for i in b:
			s2 += int(i)
		if s1 == s2:
			return True
		else:
			return False


class Solution:

	def balancedNumber(self, N):
		s1 = str(N)
		n = len(s1)
		ls = 0
		rs = 0
		(i, j) = (0, n - 1)
		while i < j:
			ls = ls + int(s1[i])
			rs = rs + int(s1[j])
			i += 1
			j -= 1
		if ls == rs:
			return 1
		else:
			return 0


class Solution:

	def balancedNumber(self, N):
		suml = 0
		sumr = 0
		arr = list(N)
		n = len(arr)
		k = len(arr) // 2
		for i in range(k + 1):
			suml += int(arr[i])
			sumr += int(arr[n - i - 1])
		if suml == sumr:
			return 1
		else:
			return 0


class Solution:

	def balancedNumber(self, N):
		N = str(N)
		n1 = N[0:len(N) // 2]
		n2 = N[len(N) // 2 + 1:len(N)]
		s1 = 0
		s2 = 0
		for i in range(len(n1)):
			s1 += int(n1[i])
			s2 += int(n2[i])
		if s1 == s2:
			return True
		return False


class Solution:

	def balancedNumber(self, N):
		l = len(N)
		if l % 2 != 0:
			a = N[0:l // 2]
			b = N[l // 2 + 1:l]
			al = list(a)
			bl = list(b)
			a1 = [int(i) for i in al]
			b1 = [int(i) for i in bl]
			s1 = sum(a1)
			s2 = sum(b1)
			if s1 == s2:
				return True
			else:
				return False


class Solution:

	def balancedNumber(self, N):
		N = str(N)
		l = len(N)
		s1 = N[:l // 2]
		s2 = N[l // 2 + 1:]
		s1 = list(s1)
		s2 = list(s2)
		s1 = list(map(int, s1))
		s2 = list(map(int, s2))
		if sum(s1) == sum(s2):
			return 1
		else:
			return 0


class Solution:

	def balancedNumber(self, N):
		n = len(N)
		s1 = N[:n // 2]
		s2 = N[n // 2 + 1:]
		a = 0
		b = 0
		for i in s1:
			a += int(i)
		for j in s2:
			b += int(j)
		if a == b:
			return 1
		return 0


class Solution:

	def balancedNumber(self, N):
		l = N[:len(N) // 2]
		r = N[len(N) // 2 + 1:]
		c = 0
		for i in l:
			c += int(i)
		d = 0
		for i in r:
			d += int(i)
		if c == d:
			return 1
		return 0


class Solution:

	def balancedNumber(self, n):
		n = str(n)
		li = [eval(i) for i in n]
		mid = len(li) // 2
		summ1 = sum(li[:mid + 1])
		summ2 = sum(li[mid:])
		if summ1 == summ2:
			return 1
		return 0


class Solution:

	def balancedNumber(self, N):
		l = len(N)
		a = N[:l // 2]
		x = 0
		y = 0
		b = N[l // 2 + 1:]
		for i in a:
			x = x + int(i)
		for i in b:
			y = y + int(i)
		if x == y:
			return 1
		else:
			return 0


class Solution:

	def balancedNumber(self, N):
		s = str(N)
		s1 = 0
		s2 = 0
		n = len(N) // 2
		first = s[0:n]
		last = s[n + 1:]
		for i in first:
			s1 += int(i)
		for j in last:
			s2 += int(j)
		if s1 == s2:
			return 1
		else:
			return 0


class Solution:

	def balancedNumber(self, N):
		s = str(N)
		left = 0
		right = 0
		res = 0
		while right < len(N) - 1:
			res += int(s[left])
			left += 1
			right += 2
		return res == sum(list(map(int, s[left + 1:])))


class Solution:

	def balancedNumber(self, N):
		c = len(N) // 2
		x = 0
		y = 0
		for i in range(c):
			x += int(N[i])
		for i in range(c + 1, len(N)):
			y += int(N[i])
		return x == y


class Solution:

	def balancedNumber(self, N):
		s = str(N)
		middle = len(s) // 2
		c = 0
		d = 0
		for i in range(0, middle):
			c += int(s[i])
		for j in range(middle + 1, len(s)):
			d += int(s[j])
		if c == d:
			return 1
		else:
			return 0


class Solution:

	def balancedNumber(self, N):
		b = 0
		c = 0
		s = len(N) // 2
		N = str(N)
		d = N[0:s]
		f = N[s + 1:]
		for i in d:
			b += int(i)
		for j in f:
			c += int(j)
		if b == c:
			return 1
		else:
			return 0


class Solution:

	def balancedNumber(self, N):
		l = len(N)
		s = N[:l // 2]
		k = N[l // 2 + 1:]
		s1 = 0
		s2 = 0
		for i in s:
			s1 += int(i)
		for j in k:
			s2 += int(j)
		if s1 == s2:
			return 1
		else:
			return 0


class Solution:

	def balancedNumber(self, N):
		a = str(N)
		n = len(a) // 2
		lcm = 0
		hcm = 0
		c = a[:n]
		d = a[n + 1:]
		for i in range(len(c)):
			lcm += int(c[i])
			hcm += int(d[i])
		if lcm == hcm:
			return True
		else:
			return False


class Solution:

	def balancedNumber(self, N):
		x = str(N)
		n = len(x) // 2
		l = []
		l1 = []
		for i in range(0, n, 1):
			l.append(x[i])
			l1.append(x[len(x) - i - 1])
		x = 0
		x1 = 0
		for i in range(len(l)):
			x = x + int(l[i])
			x1 = x1 + int(l1[i])
		if x == x1:
			return True
		return False


class Solution:

	def balancedNumber(self, N):
		l = len(N)
		s1 = N[:l // 2]
		s2 = N[l // 2 + 1:]
		su1 = 0
		su2 = 0
		for i in s1:
			su1 += int(i)
		for i in s2:
			su2 += int(i)
		if su1 == su2:
			return True
		else:
			return False


class Solution:

	def balancedNumber(self, N):
		if len(N) == 1:
			return 1
		length = int(len(N) / 2)
		l_sum = 0
		r_sum = 0
		l_num = N[:length]
		r_num = N[-length:]
		for num in l_num:
			l_sum = l_sum + int(num)
		for num in r_num:
			r_sum = r_sum + int(num)
		if l_sum == r_sum:
			return 1
		else:
			return 0


class Solution:

	def balancedNumber(self, n):
		(l, r) = (0, 0)
		n = str(n)
		(i, j) = (0, len(n) - 1)
		while i < j:
			l += int(n[i])
			r += int(n[j])
			i += 1
			j -= 1
		return l == r


class Solution:

	def balancedNumber(self, N):
		res = [int(x) for x in str(N)]
		a = len(res) // 2
		b = 0
		c = 0
		for i in range(a):
			b += res[i]
		for i in range(a + 1, len(res)):
			c += res[i]
		if b == c:
			return 1
		else:
			return 0


class Solution:

	def balancedNumber(self, N):
		s = str(N)
		len_s = len(s)
		middle = len_s // 2
		num1 = s[0:middle]
		sum1 = 0
		sum2 = 0
		num2 = s[middle + 1:len_s]
		for i in range(len(num1)):
			sum1 += int(num1[i])
			sum2 += int(num2[i])
		if sum1 == sum2:
			return 1
		else:
			return 0


class Solution:

	def balancedNumber(self, N):
		s = str(N)
		i = 0
		j = len(s) - 1
		l = 0
		r = 0
		while i < j:
			l = l + int(s[i])
			r = r + int(s[j])
			i = i + 1
			j = j - 1
		if l == r:
			return 1
		return 0


class Solution:

	def balancedNumber(self, N):
		num = str(N)
		n = len(num)
		num1 = num[:n // 2]
		num2 = num[n // 2 + 1:]
		(sum1, sum2) = (0, 0)
		for i in num1:
			sum1 += int(i)
		for i in num2:
			sum2 += int(i)
		if sum1 == sum2:
			return True
		return False


class Solution:

	def balancedNumber(self, n):
		mid = len(str(n)) // 2
		l = 0
		n = str(n)
		for i in range(mid):
			l = l + int(n[i])
		h = 0
		for i in range(mid + 1, len(n)):
			h = h + int(n[i])
		if l == h:
			return True
		else:
			return False


class Solution:

	def balancedNumber(self, N):
		LHS = sum([int(i) for i in N[:len(N) // 2 + 1]])
		RHS = sum([int(i) for i in N[len(N) // 2:]])
		return LHS == RHS


class Solution:

	def balancedNumber(self, N):
		a = len(str(N))
		b = str(N)
		if a % 2 == 0:
			t = 0
			r = 0
			w = b[:int(a / 2)]
			q = b[int(a / 2):]
			for (i, j) in zip(w, q):
				t += int(i)
				r += int(j)
			if t == r:
				return 1
			return 0
		else:
			t = 0
			r = 0
			w = b[:int(a / 2)]
			q = b[int(a / 2) + 1:]
			for (i, j) in zip(w, q):
				t += int(i)
				r += int(j)
			if t == r:
				return 1
			return 0


import statistics

class Solution:

	def balancedNumber(self, N):
		l = 0
		r = 0
		for i in range(0, int(len(N) / 2)):
			l = l + int(N[i])
			r = r + int(N[len(N) - 1 - i])
		if l == r:
			return 1
		else:
			return 0


class Solution:

	def balancedNumber(self, N):
		sum = 0
		cum = 0
		for i in range(0, len(N) // 2):
			sum += int(N[i])
		for j in range(len(N) // 2 + 1, len(N)):
			cum += int(N[j])
		if sum == cum:
			return 1
		else:
			return 0


class Solution:

	def balancedNumber(self, N):
		number = str(N)
		middle = len(number) // 2
		left_sum = 0
		right_sum = 0
		for i in range(middle):
			left_sum += int(number[i])
			right_sum += int(number[len(number) - 1 - i])
		if left_sum == right_sum:
			return 1
		return 0


class Solution:

	def balancedNumber(self, N):
		mid = len(N) // 2
		S = list(N)
		left = 0
		for i in range(mid):
			left += int(S[i])
		right = 0
		for j in range(mid + 1, len(N)):
			right += int(S[j])
		if left == right:
			return 1
		else:
			return 0


class Solution:

	def balancedNumber(self, N):
		a = ''
		b = ''
		n = len(N)
		m = n // 2
		a = N[0:m]
		b = N[m + 1:]
		c = 0
		d = 0
		for i in a:
			if i.isdigit():
				c += int(i)
		for i in b:
			if i.isdigit():
				d += int(i)
		if c == d:
			return 1
		else:
			return 0


class Solution:

	def balancedNumber(self, N):
		x = str(N)
		y = len(x)
		a = 0
		b = 0
		for i in range(y // 2):
			a += int(x[i])
		for i in range(y // 2 + 1, y):
			b += int(x[i])
		return a == b


class Solution:

	def balancedNumber(self, N):
		num_str = str(N)
		l = len(num_str)
		left_sum = 0
		for i in range(l // 2):
			left_sum += int(num_str[i])
		right_sum = 0
		for i in range(l // 2 + 1, l):
			right_sum += int(num_str[i])
		return left_sum == right_sum


class Solution:

	def balancedNumber(self, N):
		a = 0
		for i in range(0, len(N) // 2):
			a = a + int(N[i])
		b = 0
		for j in range(len(N) // 2 + 1, len(N)):
			b = b + int(N[j])
		if a == b:
			return 1
		else:
			return 0


class Solution:

	def balancedNumber(self, N):
		n = len(N)
		left = list(map(int, N[:n // 2]))
		right = list(map(int, N[n // 2 + 1:]))
		if sum(left) == sum(right):
			return True
		return False


class Solution:

	def balancedNumber(self, N):
		s = str(N)
		t = (len(s) + 1) // 2
		sum1 = 0
		sum2 = 0
		for i in range(t - 1):
			sum1 = sum1 + int(s[i])
		for j in range(t, len(s)):
			sum2 = sum2 + int(s[j])
		if sum1 == sum2:
			return 1
		else:
			return 0


class Solution:

	def balancedNumber(self, N):
		(l, rs, ls) = (len(N), 0, 0)
		for i in range(l // 2):
			ls += int(N[i])
		for i in range(l // 2 + 1, l):
			rs += int(N[i])
		if rs == ls:
			return 1
		return 0


class Solution:

	def balancedNumber(self, N):
		mid = (len(N) + 1) / 2
		N1 = str(N)
		s1 = 0
		s2 = 0
		for i in range(len(str(N1))):
			if int(i) < mid - 1:
				s1 += int(N1[i])
			elif int(i) > mid - 1:
				s2 += int(N1[i])
		if s1 == s2:
			return 1
		else:
			return 0


class Solution:

	def balancedNumber(self, N):
		N = str(N)
		m = (len(N) + 1) // 2
		l = []
		s1 = 0
		s2 = 0
		for i in range(0, len(N)):
			l.append(int(N[i]))
		for i in range(0, m - 1):
			s1 = s1 + l[i]
		for i in range(m, len(N)):
			s2 = s2 + l[i]
		if s1 == s2:
			return 1
		else:
			return 0


class Solution:

	def balancedNumber(self, N):
		C = []
		for i in N:
			C.append(int(i))
		a = sum(C[:len(C) // 2])
		b = sum(C[len(C) // 2 + 1:])
		if a == b:
			return 1
		return 0


class Solution:

	def balancedNumber(self, N):
		LHS_sum = 0
		RHS_sum = 0
		middle = N[len(N) // 2]
		if middle >= '0' and middle <= '9':
			for i in range(len(N) // 2):
				LHS_sum += int(N[i])
			for i in range(len(N) // 2 + 1, len(N)):
				RHS_sum += int(N[i])
			if LHS_sum == RHS_sum:
				return True
			return False
		return False


class Solution:

	def balancedNumber(self, N):
		s = str(N)
		l = len(s)
		front = 0
		end = 0
		mid = l // 2
		for i in range(mid):
			front += int(s[i])
			end += int(s[-(i + 1)])
		return front == end


class Solution:

	def balancedNumber(self, N):
		Mid = len(N) // 2
		left_sum = 0
		right_sum = 0
		for i in N[:Mid]:
			left_sum += int(i)
		for i in N[Mid + 1:]:
			right_sum += int(i)
		if left_sum == right_sum:
			return 1
		return 0


class Solution:

	def balancedNumber(self, N):
		L = 0
		R = 0
		mid = N[len(N) // 2]
		if mid >= '0' and mid <= '9':
			for i in range(len(N) // 2):
				L += int(N[i])
			for i in range(len(N) // 2 + 1, len(N)):
				R += int(N[i])
			if L == R:
				return True
			return False
		return False


class Solution:

	def balancedNumber(self, N):
		N = str(N)
		l = len(N) // 2
		a = sum(list(map(int, N[:l])))
		b = sum(list(map(int, N[l + 1:])))
		if a == b:
			return 1
		return 0


class Solution:

	def balancedNumber(self, N):
		N = list(str(N))
		N = list(map(int, N))
		k = len(N) // 2
		(lhs, rhs) = (sum(N[:k]), sum(N[k + 1:]))
		if rhs == lhs:
			return 1
		return 0


class Solution:

	def balancedNumber(self, N):
		A = len(N) - 1
		B = A / 2
		sum = 0
		sum1 = 0
		for a in range(0, len(N)):
			if a < B:
				value1 = int(N[a])
				sum = sum + value1
			elif a > B:
				value2 = int(N[a])
				sum1 = sum1 + value2
		if sum == sum1:
			return True
		else:
			return False


import math

class Solution:

	def balancedNumber(self, N):
		mid = len(N) // 2
		s = str(N)
		ls = 0
		rs = 0
		for i in range(0, mid):
			ls += int(s[i])
		for i in range(mid + 1, len(N)):
			rs += int(s[i])
		if ls == rs:
			return 1
		return 0


class Solution:

	def balancedNumber(self, N):
		number = str(N)
		sum_left = 0
		sum_right = 0
		mid = len(number) // 2
		for i in range(len(number)):
			if i < mid:
				sum_left += int(number[i])
			if i > mid:
				sum_right += int(number[i])
		if sum_left == sum_right:
			return 1
		else:
			return 0


class Solution:

	def balancedNumber(self, N):
		x = len(N) // 2
		a = N[:x + 1]
		b = N[x:]
		(l1, l2) = ([], [])
		for i in a:
			i = int(i)
			l1.append(i)
		for j in b:
			j = int(j)
			l2.append(j)
		c = sum(l1)
		d = sum(l2)
		if c == d:
			return 1
		else:
			return 0


class Solution:

	def balancedNumber(self, N):
		Leftsum = 0
		Rightsum = 0
		for i in range(0, int(len(N) / 2)):
			Leftsum = Leftsum + int(N[i])
			Rightsum = Rightsum + int(N[len(N) - 1 - i])
		if Leftsum == Rightsum:
			return 1
		else:
			return 0


class Solution:

	def balancedNumber(self, N):
		s = str(N)
		l = []
		for i in range(len(s)):
			l.append(s[i])
		x = len(s) // 2
		sum = 0
		sum1 = 0
		for i in range(0, x):
			sum += int(l[i])
		for j in range(x + 1, len(s)):
			sum1 += int(l[j])
		if sum == sum1:
			return True
		else:
			return False


class Solution:

	def add(self, s):
		c = 0
		for i in s:
			c += int(i)
		return c

	def balancedNumber(self, N):
		a = len(N)
		b = a // 2
		s1 = N[0:b]
		s2 = N[b + 1:]
		c1 = self.add(s1)
		c2 = self.add(s2)
		if c1 == c2:
			return 1
		return 0


class Solution:

	def balancedNumber(self, N):
		S = str(N)
		l = len(S)
		mid = l // 2
		sm1 = 0
		sm2 = 0
		for i in range(0, mid):
			sm1 += int(S[i])
		for i in range(mid + 1, l):
			sm2 += int(S[i])
		if sm1 == sm2:
			return True
		else:
			return False


class Solution:

	def balancedNumber(self, N):
		return sum([int(i) for i in str(N)[:len(str(N)) // 2]]) == sum([int(i) for i in str(N)[len(str(N)) // 2 + 1:]])


class Solution:

	def balancedNumber(self, N):
		s = str(N)
		mid = len(N) // 2
		lhs = sum(map(int, s[:mid]))
		rhs = sum(map(int, s[mid + 1:]))
		return lhs == rhs


class Solution:

	def balancedNumber(self, N):
		sum1 = 0
		sum2 = 0
		for i in range(0, len(N) // 2):
			sum1 = sum1 + int(N[i])
		for j in range(len(N) // 2 + 1, len(N)):
			sum2 = sum2 + int(N[j])
		if sum1 == sum2:
			return True
		else:
			return False


class Solution:

	def balancedNumber(self, N):
		string = str(N)
		mid = len(string) // 2
		part1 = string[:mid]
		part2 = string[mid + 1:]
		s1 = 0
		s2 = 0
		for i in part1:
			s1 += int(i)
		for i in part2:
			s2 += int(i)
		if s1 == s2:
			return 1
		else:
			return 0


class Solution:

	def balancedNumber(self, N):
		left = 0
		right = 0
		mid = len(N) // 2
		s1 = N[:mid]
		s2 = N[mid + 1:]
		for i in s1:
			left = left + int(i)
		for j in s2:
			right = right + int(j)
		if left == right:
			return 1
		return 0


class Solution:

	def balancedNumber(self, N):
		mid = len(N) // 2
		m = n = 0
		for i in range(mid):
			m += int(N[i])
		for j in range(mid + 1, len(N)):
			n += int(N[j])
		if m == n:
			return True
		else:
			return False