Farz0l1x

Untitled

Dec 7th, 2023
631
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.33 KB | None | 0 0
  1. s = '>' + 26 * '1' + 10 * '2' + 14 * '3'
  2. while '>1' in s or '>2' in s or '>3' in s:
  3.     if '>1' in s:
  4.         s = s.replace('>1', '22>', 1)
  5.     if '>2' in s:
  6.         s = s.replace('>2', '2>', 1)
  7.     if '>3' in s:
  8.         s = s.replace('>3', '1>', 1)
  9. sum = 0        
  10. for i in range(len(s) - 1):
  11.     sum += int(s[i])
  12. print(sum)
Advertisement
Add Comment
Please, Sign In to add comment