fork(17) download
  1. inCase = raw_input()
  2. maxInt = 0
  3. current = ""
  4. cInt = ['1','2','3','4','5','6','7','8','9','0']
  5. LetterUse = False
  6. index = 0
  7.  
  8. for element in inCase:
  9. if(element in cInt): ## is a number
  10. current+=element
  11. else: ## is a letter
  12. if(LetterUse == True):
  13. if(inCase[index-1] in cInt): ## previous element was a number
  14. current=inCase[index-1] + "9"
  15. else: ## prev index not a number start from scratch
  16. current = "9"
  17. else:
  18. current+="9"
  19. LetterUse = True
  20.  
  21. if(int(current) > maxInt):
  22. maxInt = int(current)
  23.  
  24. index+=1
  25.  
  26. print maxInt
Success #stdin #stdout 0.01s 7732KB
stdin
DDD
stdout
9