You are viewing a single comment's thread. Return to all comments →
We know the output as follow:
we can iterate over range 'n' and add these values to set remove duplicates.
def stones(n, a, b): # Write your code here st = set() for i in range(n): num = (n-i-1)*b + i*a st.add(num) return sorted(st)
Seems like cookies are disabled on this browser, please enable them to open this website
Manasa and Stones
You are viewing a single comment's thread. Return to all comments →
We know the output as follow:
we can iterate over range 'n' and add these values to set remove duplicates.