Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def lovushka(s, m, n):
- if m != 0:
- s = s + '0'
- lovushka(s, m - 1, n)
- s = s[:-1:]
- if n != 0:
- s = s + '1'
- lovushka(s, m, n - 1)
- s = s[:-1]
- if m + n == 0:
- ans.append(s)
- m, n = map(int, input().split())
- ans = []
- lovushka("", m, n)
- print(ans)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement