Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[C++] Competitive (LeetCode & SPOJ) #94

Merged
merged 4 commits into from
Oct 1, 2020

Conversation

trivediavinash
Copy link
Contributor

I have added the new solutions in C++/competitive

@trivediavinash
Copy link
Contributor Author

@amanmehara Please review my PR

@@ -0,0 +1,42 @@
// Copyright 2020 Avinash Trivedi
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Align the licence header correctly.

@@ -0,0 +1,60 @@
// Copyright 2020 Avinash Trivedi
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Align the licence header correctly.

}

return 0;
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add newline at end of file.

return sum;

}
};
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add newline at end of file.


return ms;
}
};
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add newline at end of file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@amanmehara should i add extra line after line no 42

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

@amanmehara
Copy link
Owner

Please have a look at https://github.com/amanmehara/programming/blob/master/CONTRIBUTING.md and make changes accordingly.
I'll approve and merge afterwards! 😃

@trivediavinash
Copy link
Contributor Author

@amanmehara I have done the changes .

Copy link
Owner

@amanmehara amanmehara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@trivediavinash The changes are good. 😃
Some minor comments.
I'll approve and merge after they are fixed.

@@ -0,0 +1,40 @@
// Copyright 2020 Avinash Trived
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your name is incorrect! 😛

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@amanmehara Yeah i corrected that 😃

Comment on lines 31 to 56
fast

intt n;
cin >> n;
intt a[n];
for (intt i = 0; i < n; i++)
{
cin >> a[i];
}

intt k;
cin >> k;
for (intt i = 0; i < k; i++)
{
intt x, y;
cin >> x >> y;
intt sum = 0;
for (intt i = x; i <= y; i++)
{
sum += a[i];
}

cout << sum << endl;
}

return 0;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add some comments explaining the steps.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@amanmehara Done with the changes

@amanmehara amanmehara changed the title AddedCodeInC++ [C++] Competitive (LeetCode & SPOJ) Oct 1, 2020
Copy link
Owner

@amanmehara amanmehara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contributing! 🎉

@amanmehara amanmehara merged commit d20e124 into amanmehara:master Oct 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants