Advertisement
Guest User

uniqueSum.py

a guest
Apr 1st, 2024
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. # By: Pedro Izecksohn
  2.  
  3. def uniqueSum(l):
  4.     total=0
  5.     for s in l:
  6.         conjunto=set()
  7.         contains=False
  8.         for c in s:
  9.             if c in conjunto:
  10.                 contains=True
  11.                 break
  12.             conjunto.add(c)
  13.         if contains:
  14.             continue
  15.         total+=int(s)
  16.     return total
  17.        
  18. if __name__=="__main__":
  19.     l=input().split(" ")
  20.     print(uniqueSum(l))
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement