How was your Goldman Sachs exam?

The first two questions are quite easy, but the third one is hard for me.
I really dont know what to in advance problem there.


Dynamic programming !!!


I’m struggling to improve dP, though if u know any similar problem on CC or cf please link it.

Google maximum sum with plus sign in a matrix


Could you please explain how you solved that problem ? The goldmann sachs question .

Is you familiar with this If not please look at that once . Amazing collection of some most important questions on DP .

1 Like

When did it happen ? who could have applied for the exam ? :sweat_smile:
I had no idea about this.

Did you manage to pass entire test set?

what is the formula for getting no of ways of subsets in second program?

its formula is nCr, n=primesum+k-1 and r=k-1

int minimizeMeetingCost(int N, int M, vector<vector<int>>& costs) {

    vector<vector<int>> up(N,vector<int>(M,0));
    vector<vector<int>> down=up,left=up,right=up;

    for(int i=0;i<N;i++)
        for(int j=0;j<M;j++)

    for(int i=0;i<N;i++)
        for(int j=M-1;j>=0;j--)

    for(int j=0;j<M;j++)
        for(int i=0;i<N;i++)

    for(int j=0;j<M;j++)
        for(int i=N-1;i>=0;i--)
    int ans = numeric_limits<int>::max();
    for(int i = 0;i<N;i++)
        for(int j=0;j<M;j++)
            ans=min(ans, up[i][j] + down[i][j] - 3*cost[i][j] + left[i][j] + right[i][j]);
    return ans;


I did this for Hotel question but it was giving Abort Error in 3 Test Cases can anyone tell me the mistake?

same here me too,why was that can anyone explain

do u pass all test cases,we were getting abort

Just asking , Im new to competitive programming
can you please tell me how did you got the idea?

link programming is mostly on the skill of googling, you just have to search.


how you derive this formula @nvdrag123

can anyone give me link for the questions?

for which problem @i_love_lucie

all of them…

its standard stars and bars problem i have provided link above