Computer Science, asked by ritesh7229983, 6 months ago

A data company wishes to stores it's data files on the server. they wish to store N files. each file has a particular size. the server stores the files in bucket. the bucket id is calculated as the sum of the digits of its file size. the server returns the bucket id for every file request where the file is stored. Write an algorithm to find the bucket id where the files are stored.​

Answers

Answered by poojan
40

Language used: Python programming version 2.7

Program:

no_of_files = int(input())

file_size_list = list(raw_input().split(' ')

bucket_id=" "

for file_size in file_size_list:

    bucket_id = bucket_id + str(sum(int(digit) for digit in file_size)) + " "

print(bucket_id)

Input:

4

43 345 20 987

Output:

7 12 2 24

Learn more:

1. The Factors that determine the quality of a software system are

https://brainly.in/question/32518314

2. A data company wishes to stores it's data files on the server. they wish to store N files. each file has a particular size. the server stores the files in bucket. the bucket id is calculated as the sum of the digits of its file size. the server returns the bucket id for every file request where the file is stored. Write an algorithm to find the bucket id where the files are stored.​

https://brainly.in/question/27657801

 

Similar questions
Math, 3 months ago