Company: Natwest
Difficulty: medium
Maximum Daily Revenue Problem Description A company has a sales record of N products for M days. The company wishes to know the maximum revenue received from a given product of the N products each day. Write an algorithm to find the highest revenue received 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. Examples Example 1: Input: 3 4 100 198 333 323 122 232 221 111 223 565 245 764 Output: 333 232 764 Explanation: The maximum revenue received on the first day is 333, followed by a maximum revenue of 232 on the second day and a maximum revenue of 764 on the third day.