Advertisement
Guest User

Untitled

a guest
Nov 27th, 2014
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. s = raw_input()
  2. lmax = 0
  3. ltemp = 0
  4. sout = ''
  5. stemp = ''
  6. for i in xrange(len(s)):
  7. if s[i] in stemp:
  8. p = stemp.find(s[i])
  9. stemp = stemp[p + 1:]
  10. stemp += s[i]
  11. ltemp = len(stemp)
  12. else:
  13. stemp += s[i]
  14. ltemp += 1
  15. if lmax < ltemp:
  16. lmax = ltemp
  17. sout = stemp
  18. print sout
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement