def sumOrProduct(n, q):
sum=0
product=1
mode=10**9+7
if q==1:
for i in range(1,n+1):
sum+=i
return sum
if q==2:
for i in range(1,n+1):
product*=i
return product%mode
This blog has content related to python programing language and Automation with python and hacker rank solutions , leet code solution
Comments
Post a Comment