-
-
Notifications
You must be signed in to change notification settings - Fork 12
Description
The intent with this issue is to facilitate a discussion about proposed changes to the Difference of Squares mentor suggestion output. (A) pull request(s) can be submitted and linked to this issue to retain historical context.
This question was asked in the #track-go channel: https://exercism-team.slack.com/archives/CAS0EK88H/p1558543383014700
...and answered/discussed further here: https://exercism-team.slack.com/archives/CAS0EK88H/p1558543810015800
At the moment, the proposals for changes to the copy are:
These formulas are not as straightforward as they seem, and you aren't expected to create an efficient solution on your own. We encourage you to ask questions and do a little research. Finding the best algorithm is a key skill in software engineering.
and:
A loop or two will get this done brute force, but you can do better. Try looking at: _ ...and then have a couple of links to math pages.
and:
These formulas are absolutely as straightforward as they seem.
I would propose using these formulas are not obvious rather than these formulas are not as straightforward as they seem. While these algorithms may seem simple and elegant, many students (including myself) will not know/remember that they exist until prompted by a mentor to try searching for them:
func SquareOfSum(n int) int {
sum := n * (n + 1) / 2
return sum * sum
}
func SumOfSquares(n int) int {
return (n * (n + 1) * (2*n + 1)) / 6
}