• + 0 comments

    I have submitted my code in Python 3. But i am seeing runtime error for few of the testcases. Please suggest what need to change.

    !/bin/python3

    import math import os import random import re import sys

    def repeatedString(s, n): # Write your code here if s == 'a': return n elif (1 <= len(s) <= 100) and (1 <= n <=1000000000000): i = int(n / len(s)) st = s * i i = int(n % len(s)) st = st + s[0:i] return (st.count('a')) else: return 0 if name == 'main': fptr = open(os.environ['OUTPUT_PATH'], 'w') s = input() n = int(input().strip()) result = repeatedString(s, n) fptr.write(str(result) + '\n') fptr.close()