Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def repeatedString(s, n):
- converged = s*n
- got_it = converged[0:n]
- count = 0
- for x in got_it:
- if "a" in x:
- count += 1
- return count
- s = input()
- n = int(input())
- result = repeatedString(s, n)
- print(result)
- a
- 1000000000000
- Traceback (most recent call last):
- File "programs.py", line 11, in <module>
- result = repeatedString(s, n)
- File "programs.py", line 2, in repeatedString
- converged = s*n
- MemoryError
Add Comment
Please, Sign In to add comment