Given two strings A and B of equal length, find how many times the corresponding position in the two strings hold exactly the same character. The comparison should not be case sensitive. 
Example 1:
Input:
A = choice 
B = chancE
Output: 4
Explanation: characters at position 0, 1, 4 and 5
are same in the two strings A and B.
Example 2:
Input:
A = Geek 
B = gang
Output: 1
Explanation: charactera at position 0 is the
same in the two strings A and B.
Your Task:  
You dont need to read input or print anything. Complete the function sameChar() which takes the two strings A and B as input parameters and returns the count of the characters that are same in A and B.
Expected Time Complexity: O(N) where N is the length of strings A and B.
Expected Auxiliary Space: O(1) 
Constraints:
1<= A.length(), B.length() <= 10^{4}

Source: geeksforgeeks | Difficulty: EASY
Tags: String algorithms

Data structures

Starter code: #User function Template for python3

class Solution:

    def sameChar(self, A, B):
        # code here


Solutions:
class Solution:

	def sameChar(self, A, B):
		A = A.lower()
		B = B.lower()
		c = 0
		n = len(B)
		for i in range(n):
			if A[i] == B[i]:
				c += 1
		return c


class Solution:

	def sameChar(self, A, B):
		A = A.lower()
		B = B.lower()
		t = len(A)
		c = 0
		lst = []
		for i in range(t):
			if A[i] == B[i]:
				lst.append(A[i])
		return len(lst)


class Solution:

	def sameChar(self, A, B):
		a = A.lower()
		b = B.lower()
		count = 0
		for i in range(len(a)):
			if a[i] == b[i]:
				count += 1
		return count


class Solution:

	def sameChar(self, A, B):
		c = 0
		for i in range(len(A)):
			if A[i] == B[i]:
				c += 1
			elif A[i].upper() == B[i].upper():
				c += 1
		return c


class Solution:

	def sameChar(self, a, b):
		c = 0
		for i in range(len(a)):
			p = a[i].lower()
			q = b[i].lower()
			if p == q:
				c += 1
		return c


class Solution:

	def sameChar(self, A, B):
		c = 0
		n = len(B)
		for i in range(n):
			x = ord(A[i])
			y = ord(B[i])
			if x >= 97:
				x -= 32
			if y >= 97:
				y -= 32
			if x == y:
				c += 1
		return c


class Solution:

	def sameChar(self, A, B):
		res = 0
		Al = A.lower()
		Bl = B.lower()
		for i in range(len(A)):
			if Al[i] == Bl[i]:
				res += 1
		return res


class Solution:

	def sameChar(self, A, B):
		A = A.casefold()
		B = B.casefold()
		count = 0
		for i in range(len(A)):
			if A[i] in B[i]:
				count += 1
		return count


class Solution:

	def sameChar(self, A, B):
		count = 0
		for i in range(len(A)):
			if ord(A[i]) == ord(B[i]) or abs(ord(A[i]) - ord(B[i])) == 32:
				count += 1
		return count


class Solution:

	def sameChar(self, A, B):
		num = 0
		for (i, s) in enumerate(A):
			if s.lower() == B[i].lower():
				num += 1
		return num


class Solution:

	def sameChar(self, A, B):
		count = 0
		z = 0
		b = B.lower()
		for i in A.lower():
			if i == b[z]:
				count += 1
			z += 1
		return count


class Solution:

	def sameChar(self, A, B):
		count = 0
		c = A.lower()
		d = B.lower()
		x = list(c)
		y = list(d)
		for i in range(0, len(x)):
			if x[i] == y[i]:
				count += 1
		return count


class Solution:

	def sameChar(self, A, B):
		i = 0
		count = 0
		while i < min(len(B), len(A)):
			if A[i].lower() == B[i].lower():
				count += 1
			i += 1
		return count


class Solution:

	def sameChar(self, a, b):
		a = a.lower()
		b = b.lower()
		c = 0
		for (i, j) in zip(a, b):
			if i == j:
				c += 1
		return c


class Solution:

	def sameChar(self, A, B):
		A = A.lower()
		B = B.lower()
		a = 0
		for (i, j) in zip(A, B):
			if i == j:
				a = a + 1
		return a


class Solution:

	def sameChar(self, A, B):
		ans = 0
		A = A.lower()
		B = B.lower()
		for i in range(min(len(A), len(B))):
			if A[i] == B[i]:
				ans += 1
		return ans


class Solution:

	def sameChar(self, A, B):
		k = 0
		A = A.capitalize()
		B = B.capitalize()
		for i in range(len(A)):
			if A[i] == B[i]:
				k = k + 1
		return k


class Solution:

	def sameChar(self, A, B):
		strA = A.lower()
		strB = B.lower()
		count = 0
		n = len(A)
		for i in range(0, n):
			if strA[i] == strB[i]:
				count += 1
		return count


class Solution:

	def sameChar(self, A, B):
		count = 0
		A = A.lower()
		B = B.lower()
		n = min(len(A), len(B))
		for i in range(n):
			count += A[i] == B[i]
		return count


class Solution:

	def sameChar(self, string1, string2):
		count = 0
		if len(string1) != len(string2):
			return 0
		string1 = string1.lower()
		string2 = string2.lower()
		for i in range(len(string1)):
			if string1[i] == string2[i]:
				count += 1
		return count


from collections import Counter

class Solution:

	def sameChar(self, A, B):
		c = 0
		a = A.lower()
		b = B.lower()
		for i in range(len(A)):
			if a[i] == b[i]:
				c = c + 1
		return c


class Solution:

	def sameChar(self, A, B):
		(n1, n2) = (len(A), len(B))
		i = j = 0
		ans = 0
		while i < n1 and j < n2:
			ch1 = A[i].lower()
			ch2 = B[j].lower()
			if ch1 == ch2:
				ans += 1
			i += 1
			j += 1
		return ans


class Solution:

	def sameChar(self, A, B):
		lower_A = A.lower()
		lower_B = B.lower()
		count = 0
		mini = min(len(A), len(B))
		for i in range(mini):
			if lower_A[i] == lower_B[i]:
				count += 1
		return count


class Solution:

	def sameChar(self, A, B):
		count1 = 0
		k = len(A)
		for a in range(0, len(A)):
			if A[a] == B[a] or ord(A[a]) - 32 == ord(B[a]) or ord(A[a]) + 32 == ord(B[a]):
				count1 += 1
				B = B[:a] + '0' + B[a + 1:]
				A = A[:a] + '0' + A[a + 1:]
		return count1


class Solution:

	def sameChar(self, A, B):
		S1 = A.lower()
		S2 = B.lower()
		count = 0
		for i in range(len(S1)):
			if S1[i] == S2[i]:
				count += 1
		return count


class Solution:

	def sameChar(self, A, B):
		v = 0
		A = A.lower()
		B = B.lower()
		A = list(A)
		B = list(B)
		for i in range(len(A)):
			if A[i] == B[i]:
				v = v + 1
		return v


class Solution:

	def sameChar(self, A, B):
		a1 = list(A.lower())
		a2 = list(B.lower())
		ans = 0
		for i in range(0, len(A)):
			if a1[i] == a2[i]:
				ans += 1
		return ans


class Solution:

	def sameChar(self, A, B):
		A = A.lower()
		B = B.lower()
		count = 0
		i = 0
		j = 0
		while i < len(A) and j < len(B):
			if A[i] == B[j]:
				count += 1
			i += 1
			j += 1
		return count


class Solution:

	def sameChar(self, A, B):
		count = 0
		i = 0
		while i < len(A):
			for i in range(0, len(A)):
				if A[i].upper() == B[i].upper():
					count += 1
					i += 1
				else:
					pass
			return count


class Solution:

	def sameChar(self, A, B):
		x = A.upper()
		y = B.upper()
		lst_1 = list(x)
		lst_2 = list(y)
		count = 0
		for i in range(0, min(len(x), len(y))):
			if lst_1[i] == lst_2[i]:
				count += 1
		return count


class Solution:

	def sameChar(self, A, B):
		count = 0
		for x in range(len(A)):
			if A[x].lower() == B[x].lower():
				count += 1
		return count


class Solution:

	def sameChar(self, A, B):
		a = 0
		count = 0
		A = A.upper()
		B = B.upper()
		for i in A:
			if A[a] == B[a]:
				count = count + 1
			a = a + 1
		return count


class Solution:

	def sameChar(self, a, b):
		count = 0
		for idx in range(len(a)):
			if a[idx].lower() == b[idx].lower():
				count += 1
		return count


from collections import Counter

class Solution:

	def sameChar(self, A, B):
		a = A.upper()
		b = B.upper()
		count = 0
		for i in range(len(a)):
			if a[i] == b[i]:
				count += 1
		return count


class Solution:

	def sameChar(self, A, B):
		if len(A) > len(B):
			n = len(B)
		else:
			n = len(A)
		ans = 0
		for i in range(n):
			if A[i].upper() == B[i].upper():
				ans += 1
		return ans


class Solution:

	def sameChar(self, A, B):
		i = 0
		c = 0
		A = A.lower()
		B = B.lower()
		while i < len(A):
			if A[i] == B[i]:
				c += 1
			i += 1
		return c