Company: MSD

Difficulty: easy

Problem Statement

A company keeps a sales record of N products over M days. For every day and every product the record stores the revenue that the product earned on that day. Revenue may be positive (a profit) or negative (a loss, for example because of returns or discounts). For each of the M days the company wants to know the highest revenue earned by any single product on that day. Given the sales record, report the maximum revenue received on each day. Input The first line of the input consists of two space-separated integers - days and products , representing the days ( M ) and the products in the sales record ( N ), respectively. The next M lines consist of N space-separated integers - salesRecord , representing the grid of sales revenue (can be positive or negative) received from each product each day. Output Print M space-separated integers representing the maximum revenue received each day. Constraints 1 <= M <= 100 1 <= N <= 100 -10^9 <= salesRecord[i][j] <= 10^9 Every value,

More MSD OA questionsInterview experiences