Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
eysbutno
left a comment
There was a problem hiding this comment.
Is your solution different than the existing solution? Because, at least at a glance, they appear to be equivalent.
If they are essentially the same, then I think it would be more useful to improve the current solution (which is valid).
apex-kevin-s
left a comment
There was a problem hiding this comment.
reviewing from my corpo account LOOOL
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
| #include <bits/stdc++.h> | ||
| using namespace std; | ||
| #include <algorithm> | ||
| #include <stdio.h> |
There was a problem hiding this comment.
honestly i'd prefer you use cin and cout
|
is there any particular reason for replacing the existing solution code? since they appear identical in terms of functionality, and the original code is closer to the usual standards for guide code (though your code is more concise) I do think that rewriting the current explanation is worthwhile though |
The previous code used a prefix sum to calculate suffix differences, which is not required when contribution of each element could be found directly. |
good point, it'd be nice if you kept the code style the same tho (e.g. use cin/cout over scanf/printf, spacing, etc) explanation looks good |
Place an "x" in the corresponding checkbox if it is done or does not apply to this pull request.
The given solution is unnecessarily complicated.