this codes give a correct output on online interpreter but giving an error on geeksforgeeks.com with error " \'int\' object is not subscriptable "
def o