How was your Goldman Sachs exam?

you got it accepted??

Just to check if the code-stub was right in the advanced question, I returned just 0 and submitted my code, still it gave “ABORTED” on last 3 cases.
Also for problem 1 the 3rd case had n == 1 for that, we just had to return the inputArray.

5 Likes

#include<bits/stdc++.h>
using namespace std;
const int m=1000009;
int sumpf[m];
int ok[m];
void solve()
{
for(int i=2;i<m;i++)
{
if(ok[i]==0)
{
sumpf[i]=i;
for(int j=2*i;j<m;j+=i)
{
sumpf[j]+=i;
ok[j]=1;
}
}
}

}
int main()
{
solve();
// cout<<sumpf[10]<<sumpf[15];
}

1 Like

I heard about abort error from many of my friends on 3 test cases too, but no clue as till now why it happened.

stack exchange to the Rescue @l_returns XD
:joy::joy::joy:

Ya hackerrank is best…

Correct …same things happen with me in first question only 4 test case our pass but when I figured out for n equal to 1,it passes all the cases

Could you share your approach here ?

Modified Kadane’s Algorithm

During the contest, even that did not work. Atleast not for me

Does anyone know if the results are out or not??

1 Like

Please let us know whenever the results are out

2 Likes

They are supposed to be out by this week. Stay tuned :slight_smile:

1 Like

I managed to pass all TCs after switching the language from C++ to C. C++ kept giving Abort Error.

1 Like

Nice, thanks for sharing :grin:

Did anyone receive any mail from GS ?

1 Like

nope have u received?

Nope. (20 characters)

Did anyone got mail from GS?

Nope (20 characters)