How was your Goldman Sachs exam?

In 1st problem right ?

2 Likes

Yup… :smile: some random 20 character

1 Like

yes for the first one…

what was the return type of the function int or vector ???

for problem 2nd can we use this formula
primesum * k! - primsun+1

That sucks, I spend about 15 mins in Hotel question to reduce 4 matrix into 2 (saw Abort error means excess memory used) but still Abort Error and also another 10 mins for question 1’s n<=1 test case ( found it by having an infinite while loop which led to TLE) and ultimately due to lack of time I couldn’t attempt question 2.

this formula is working
primesum * k! - primsum+1
am i wrong?

Ohh that means memory issue. ****
I didn’t know.
I could have declared them globally. I could have managed to solve with less memory.

1 Like

Sad but interface doesn’t matter content matter and i don’t think their interface is such bad that you cant’t understand :upside_down_face::upside_down_face:

I liked interface. Was decent enough. Had nothing to complain about it.

1 Like

i declared globally it doesn’t work also i tested my code on n=1 on my compiler it worked.

Maybe you need to reduce it to exactly n+m memory.
4*(n+m) won’t work
We can easily reduce to n+m
Maybe still we can think for some optimizations in terms of memory.
He has got a point. What else can be incorrect except memory. My code seems perfect to me.

1 Like

Yes bro, Abort error occurs only when there is too much memory/memory issue.

Hack to this, just use global arrays rather than in function and it will work.

2 Likes

In Java 8 it was int and in Python 3 it was List. It should have been int.

For second problem how did you calculate primeSum? I used sieve and got TLE.

1 Like

The same thing happened to me too . Anyone who cleared all test cases ?

I did that only but got wrong answer . Can you post your code here ?

1 Like

In the 2nd Question?

I think 1st and 3rd were easy but I got stuck in the 2nd one ! Didn’t even get one test case correct !

I also did it in 2*(nxm) memory [correct ans] and (nxm) memory [wrong ans, did just to test] but both got abort error.