Search

Set Addition

by 10:38:00 0 comments
SOURCE CODE:



def single_digit(m):
    val=0
    for i in range(len(m)):
        val=val+m[0]*(10**(len(m)-1))
        del m[0]
    return val
def separate_digit(n):
    l=[]
    while n!=0:
        l.append(n%10)
        n=n/10
    return l[::-1]      
m=map(int,raw_input().split())
n=map(int,raw_input().split())
o=single_digit(m)+single_digit(n)
print separate_digit(o)



Input:
9 9 9
1
 
Output:
[1, 0, 0, 0]
 
 
 
Input:
1 2 3 4 5 6
2
  
Output:
[1, 2, 3, 4, 5, 8]







                              

Anonymous

Developer

This is created by GAVASKAR .

0 comments:

Post a Comment