Company: KKR_8thaug

Difficulty: easy

Problem Statement

Heaviest Worker Load A warehouse has k workers standing in a line. Each worker starts out carrying a total weight of 0 . A conveyor belt delivers m parcels one after another, in the order they appear in the array weights . When a parcel arrives, it is handed to the worker who is currently carrying the least total weight; that worker's total then increases by the weight of the parcel. If several workers are tied for the least total weight, the parcel may be handed to any one of them. After every parcel has been handed out, report the total weight carried by the heaviest worker. Input Format The first line contains two space-separated integers m and k — the number of parcels and the number of workers. The second line contains m space-separated integers weights[0], weights[1], ..., weights[m-1] — the parcel weights in delivery order. If m is 0 the second line is present but empty. Output Format Print a single integer — the total weight carried by the heaviest worker after all m parce

More KKR_8thaug OA questionsInterview experiences