gce.durai
BAN USER
Comments (6)
Reputation 20
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
0
of 0 vote
def verify_sum(sum_given) :
data_array = [1,3,5,18]
len_data = len(data_array)
for i in range(len_data) :
j = 1
while j<=len_data :
sum_array = sum(data_array[i:j])
print sum_array
if sum_array == sum_given :
return data_array[i:j]
j+=1
return -1
if __name__ == '__main__' :
print verify_sum(18)
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
- gce.durai October 03, 2016