Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- s = '>' + 26 * '1' + 10 * '2' + 14 * '3'
- while '>1' in s or '>2' in s or '>3' in s:
- if '>1' in s:
- s = s.replace('>1', '22>', 1)
- if '>2' in s:
- s = s.replace('>2', '2>', 1)
- if '>3' in s:
- s = s.replace('>3', '1>', 1)
- sum = 0
- for i in range(len(s) - 1):
- sum += int(s[i])
- print(sum)
Advertisement
Add Comment
Please, Sign In to add comment