CBI agents are investigating a case in which they came across certain names of the culprits. They decided to encode the names into the number format.
"Riya" is encoded as "729611390","Sumitha" as "73108101981109993" ,"Anandita" as "55101891039410011294" and so on. Given a String S denoting a name, Encode the name.
 
Example 1:
Input:
S = "Soni"
Output:
7310210298
Explanation:
The name when encoded gives the given Output.
Example 2:
Input:
S = " Pawan"
Output:
708811190104 
Explanation:
The name when encoded gives the given Output.
 
Your Task:
You don't need to read input or print anything. Your task is to complete the function encodeTheName() which takes a String S as input and returns a String as the encoded format.
 
Expected Time Complexity: O(|S|)
Expected Auxiliary Space: O(|S|)
 
Constraints:
1 <= |S| <= 10^{4}

Source: geeksforgeeks | Difficulty: EASY
Tags: Mathematics

Starter code: #User function Template for python3

class Solution:
    def encodeTheName(self, S):
        # code here 

Solutions:
class Solution:

	def encodeTheName(self, s):
		k = ''
		for i in range(len(s)):
			k += str(ord(s[i]) - 10 + i)
		return k


class Solution:

	def encodeTheName(self, S):
		ans = ''
		for i in range(len(S)):
			ans += str(ord(S[i]) - 10 + i)
		return ans


class Solution:

	def encodeTheName(self, S):
		l = list(S)
		k = []
		for i in l:
			k.append(ord(i))
		a = []
		for i in range(len(k)):
			a.append(str(k[i] - (10 - i)))
		return ''.join(a)


class Solution:

	def encodeTheName(self, S):
		r = ''
		c = 10
		for i in S:
			x = ord(i)
			r = r + str(x - c)
			c -= 1
		return r


class Solution:

	def encodeTheName(self, k):
		S = list(k)
		s = []
		for i in range(len(S)):
			s.append(ord(S[i]) - 10 + i)
		return int(''.join(map(str, s)))


class Solution:

	def encodeTheName(self, S):
		k = []
		d = 10
		for i in S:
			k.append(ord(i) - d)
			d = d - 1
		ans = ''.join(map(str, k))
		return ans


class Solution:

	def encodeTheName(self, S):
		a = ''
		b = 10
		for i in S:
			a += str(ord(i) - b)
			b -= 1
		return a


class Solution:

	def encodeTheName(self, S):
		s = ''
		x = 10
		for i in S:
			s += str(ord(i) - x)
			x -= 1
		return s


class Solution:

	def encodeTheName(self, S):
		ans = ''
		count = 0
		for i in S:
			ans += str(ord(i) - 10 + count)
			count += 1
		return ans


class Solution:

	def encodeTheName(self, S):
		res = ''
		c = 0
		for x in S:
			res += str(ord(x) - 10 + c)
			c += 1
		return res


class Solution:

	def encodeTheName(self, S):
		counter = 10
		ans = ''
		for i in S:
			ans += str(ord(i) - counter)
			counter -= 1
		return ans


class Solution:

	def encodeTheName(self, S):
		num = ''
		n = 10
		for x in S:
			num += str(ord(x) - n)
			n -= 1
		return num


class Solution:

	def encodeTheName(self, S):
		t = ''
		c = 0
		for i in S:
			t += str(ord(i) - 10 + c)
			c += 1
		return t


class Solution:

	def encodeTheName(self, S):
		s = ''
		n = 10
		for i in range(len(S)):
			i = ord(S[i])
			i = i - n
			n = n - 1
			s = s + str(i)
		return s
if __name__ == '__main__':
	t = int(input())
	for _ in range(t):
		S = input()
		ob = Solution()
		print(ob.encodeTheName(S))


class Solution:

	def encodeTheName(self, S):
		x = list(map(ord, S))
		for i in range(len(x)):
			x[i] -= 10 - i
		x = list(map(str, x))
		return ''.join(x)
if __name__ == '__main__':
	t = int(input())
	for _ in range(t):
		S = input()
		ob = Solution()
		print(ob.encodeTheName(S))


class Solution:

	def encodeTheName(self, S):
		k = ''
		c = 10
		for i in S:
			k += str(ord(i) - c)
			c -= 1
		return k
if __name__ == '__main__':
	t = int(input())
	for _ in range(t):
		S = input()
		ob = Solution()
		print(ob.encodeTheName(S))


class Solution:

	def encodeTheName(self, s):
		l = []
		for i in range(len(s)):
			l.append(ord(s[i]) - 10 + i)
		return ''.join(map(str, l))


class Solution:

	def encodeTheName(self, S):
		l = len(S)
		a = ''
		for i in range(l):
			b = str(ord(S[i]) - 10 + i)
			a = a + b
		return a


class Solution:

	def encodeTheName(self, S):
		my_list = []
		for i in range(len(S)):
			if S[i].isupper():
				my_list.append(str(ord(S[i]) - 10 + i))
			else:
				my_list.append(str(ord(S[i]) - 10 + i))
		x = ''.join(my_list)
		return x