Closed archit-p closed 4 years ago
I almost forgot how the entire thing works, but I think with you code, every first attempt will increase solvedWithOneSub
, no matter if it was accepted or not. No?
Right.
I did not account for the case where the problem is unsolved. Adding a check for
problem[problemId].solved > 0
should do in my opinion.
Thoughts?
Yeah, update the code please
Thanks for your contribution 🙏
My pleasure! Thanks for your efforts in maintaining such an amazing project!
Hello @sjsakib,
This pull request fixes a bug with the calculation of problems solved with one submission.
problems[problemId].attempts
stores count of attemps before first submissionsproblems[problemId].solved
stores count of right submissionssolvedWithOneSub
stores the count of how many problems were solved with one submission.Currently we do
if (problems[problemId].attempts == problems[problemId].solved) solvedWithOneSub++;
however this will prove wrong in the case where the first submission was right, and then author went on to submit more right submissions.Changing it to
if (problems[problemId].attemps == 1) solvedWithOneSub++;
seems to fix the issue in my case.Please let me know if this approach could lead to issues elsewhere!
Signed-off-by: Archit Pandey architpandeynitk@gmail.com