Add solution for Project Euler problem 191#2875
Add solution for Project Euler problem 191#2875dhruvmanila merged 4 commits intoTheAlgorithms:masterfrom darkstar:project_euler_191
Conversation
- update documentation - split out helper function but mark it with an underscore - remove redundant comments or make them more explicit/helpful
|
Please remove the comments which are self-explanatory. There's a good saying regarding it:
|
|
I'm not sure which comments you deem self-explanatory since you didn't point them out, I think all comments are valid to explain how the solution algorithm works, but maybe it's better now? |
| # if we are absent twice, or late 3 consecutive days, | ||
| # no further prize strings are possible | ||
| if late == 3 or absent == 2: | ||
| return 0 |
There was a problem hiding this comment.
I cannot hold your hand throughout your life :)
I will help you out here with this code as an example. The code here says if the late variable is 3 or the absent variable is 2 then we will return 0 and the comment says the same thing. What I want you to see is that comments are meant to explain the code ONLY if it's necessary but here the code is pretty self-explanatory. The comment here says the same thing in English.
What I basically mean here is that your code is perfect, you shouldn't need a ton of comments to explain what you have written. You don't want to keep referring to a dictionary when you're reading a book otherwise it breaks your flow.
* Project Euler problem 191 solution * Add type hints and reference links * Address requested changes - update documentation - split out helper function but mark it with an underscore - remove redundant comments or make them more explicit/helpful * Address requested changes
* Project Euler problem 191 solution * Add type hints and reference links * Address requested changes - update documentation - split out helper function but mark it with an underscore - remove redundant comments or make them more explicit/helpful * Address requested changes
Describe your change:
Checklist:
Fixes: #{$ISSUE_NO}.