In elementary arithmetic a "carry" is a digit that is transferred from one column of digits to another column of more significant digits during a calculation algorithm.

This Kata is about determining the number of carries performed during the addition of multi-digit numbers.

You will receive an input string containing a set of pairs of numbers formatted as follows:

```
123 456
555 555
123 594
```

And your output should be a string formatted as follows:

```
No carry operation
1 carry operations
3 carry operations
```

###Some Assumptions

- Assume that numbers can be of any length.
- But both numbers in the pair will be of the same length.
- Although not all the numbers in the set need to be of the same length.
- If a number is shorter, it will be zero-padded.
- The input may contain any arbitrary number of pairs.

Source: codewars | Difficulty: EASY

Starter code: def solve(s):
	

Solutions:
def solve(s):
	ans = []
	for ab in s.split('\n'):
		(carry, carried) = (0, 0)
		for (a, b) in zip(*map(lambda ss: map(int, ss[::-1]), ab.split())):
			carried += a + b
			carry += carried > 9
			carried //= 10
		ans.append(carry)
	return '\n'.join(('No carry operation' if not c else '%d carry operations' % c for c in ans))


def getCarrycount(a, b):
	(r, index) = (0, 0)
	al = [int(d) + int(f) for (d, f) in zip(reversed(list(a)), reversed(list(b)))]
	for item in al:
		index = (item + index) // 10
		r += index
	return r

def solve(input_string):
	lnumber = [tuple(item.split()) for item in input_string.split('\n')]
	lsum = [getCarrycount(z[0], z[1]) for z in lnumber]
	return '\n'.join(('{} carry operations'.format(n) if n else 'No carry operation' for n in lsum))


def solve(s):
	li = []
	for k in s.splitlines():
		c = [0]
		for (i, j) in reversed(list(zip(k.split(' ')[0], k.split(' ')[1]))):
			if int(i) + int(j) + int(c[-1]) > 9:
				c.append(str(int(i) + int(j) + int(c[-1]))[0])
			else:
				c.append(0)
		li.append('No carry operation' if c.count('1') < 1 else f"{c.count('1')} carry operations")
	return '\n'.join(li)


def solve(input_string):
	res = []
	for i in input_string.split('\n'):
		res.append(carry(i.split()[0], i.split()[1]))
	return '\n'.join(res)

def carry(s1, s2):
	carry = 0
	increment = 0
	for (i, j) in zip(s1[::-1], s2[::-1]):
		digit = int(i) + int(j) + increment
		increment = 1 if digit >= 10 else 0
		carry += increment
	return 'No carry operation' if not carry else f'{carry} carry operations'


def solve(string):
	operations = []
	for line in string.split('\n'):
		(num1, num2) = line[::-1].split()
		(carries, carry) = (0, 0)
		for (v1, v2) in zip(num1, num2):
			(v1, v2) = (int(v1), int(v2))
			v3 = v1 + v2 + carry
			v4 = v3 % 10
			if carry:
				carries += v4 <= max(v1, v2)
			else:
				carries += v4 < max(v1, v2)
			carry = int(v3 > 9)
		if carries:
			operations.append(f'{carries} carry operations')
		else:
			operations.append('No carry operation')
	return '\n'.join(operations)


def solve(input_string):
	answer = []
	for n in input_string.split('\n'):
		(carry, carried) = (0, 0)
		(A, B) = map(str, n[::-1].split())
		for x in range(len(A)):
			carried += int(A[x]) + int(B[x])
			carry += carried > 9
			carried //= 10
		answer.append(carry)
	return '\n'.join(('No carry operation' if not c else '%d carry operations' % c for c in answer))


def ss(n):
	return sum(map(int, str(n)))

def solve(s):
	s = s.split('\n')
	ans = []
	for i in s:
		(j, k) = map(int, i.split())
		c = (-ss(j + k) + ss(k) + ss(j)) // 9
		cc = 'No' if c == 0 else str(c)
		ans.append(cc + ' carry operation' + 's' * (c > 0))
	return '\n'.join(ans)


def carry(s):
	(a, b) = s.split()
	(c, f) = (0, 0)
	for (i, j) in zip(map(int, a[::-1]), map(int, b[::-1])):
		if i + j + f > 9:
			f = 1
			c += 1
		else:
			f = 0
	return c

def solve(s):
	r = list(map(carry, s.splitlines()))
	return '\n'.join(('No carry operation' if x == 0 else f'{x} carry operations' for x in r))


def carry(x, y):
	x = [*map(int, x[::-1])]
	y = [*map(int, y[::-1])]
	r = 0
	c = 0
	for (a, b) in zip(x, y):
		v = a + b + c
		if v > 9:
			r += 1
		c = v // 10
	return f'{r} carry operations' if r else 'No carry operation'

def solve(input_string):
	return '\n'.join((carry(*s.split()) for s in input_string.split('\n')))