snakeonbasket
BAN USER- 1of 1 vote
AnswersGiven a list of coin values, and quantity of each type of coin. Write a
- snakeonbasket in United States
program to return the set of all possible sums which can be made using those
coins.
ex. coins = [10, 50, 100, 500]
quantity = [5, 3, 2, 2]
sum could be 400 , 300 ,200 , 100| Report Duplicate | Flag | PURGE
Google Software Engineer Algorithm
N = 50
alist = [x for x in range(N)]
print(alist)
#print(alist)
#print('HI')
k = 3
count=0
for i in range(len(alist)):
if alist[i]==k: count+=1
elif alist[i] > 9:
temp = alist[i]
while (temp>9):
if temp%10==k: count+=1
temp = temp//10
if temp==k: count+=1
print(count)
Could you please elaborate the question. Are we supposed to remove only the triplets or any kind of duplicate elements whether they are double, triple or quadriple ?
- snakeonbasket January 18, 2017
PYTHON CODE --> ALL TEST CASES HANDLED
- snakeonbasket January 19, 2017