Need help in Goldman Sachs online assessment problem!!

Revision en1, by banyanTree123456789, 2021-07-29 10:07:46

This problem was asked by Goldman Sachs yesterday for hiring interns at IIT Kharagpur:
Given a N x 3 grid with numbers written in the cells. You have K, 2 x 1 tiles which you can put to cover some cells. The numbers written on those two cells is added to your score which was initially zero. Find the maximum possible score you can achieve.The tiles can be placed horizontally or vertically.

Constraints:
1<=N<=1000
1<=K<=1000
Example:
N = 2
K = 2
0 4 1
1 0 4
Ans = (4 + 1) + (0 + 4)

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English banyanTree123456789 2021-07-29 10:07:46 593 Initial revision (published)