Skip to content

Commit a47255b

Browse files
authored
[Pythagorean Triplet] Fix typos (#3742)
1 parent f4e036a commit a47255b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

exercises/practice/pythagorean-triplet/.approaches/introduction.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The problem space can easily become very large, and 'naive' or more 'brute force
66
There are three reasonably common variations to this problem
77
1. A [cubic time][approaches-cubic] solution, which uses highly nested loops and is non-performant.
88
2. A [quadratic time][approaches-quadratic] solution, which uses one nested loop, and is reasonably easy to figure out.
9-
3. A [linear time][approaches-linear] solution, requiring some deeper understanding of the mathematics of finding trplets.
9+
3. A [linear time][approaches-linear] solution, requiring some deeper understanding of the mathematics of finding triplets.
1010

1111

1212
If those terms are unclear to you, you might like to read about [time complexity][time-complexity], and how it is described by [asymptotic notation][asymptotic-notation].
@@ -68,7 +68,7 @@ This gives a substantial speed advantage, allowing the tests to run to completio
6868

6969
However, the Exercism online test runner will still time out with this solution.
7070

71-
Examining the code, it is clear that the upper bounds on the `loop` variables are far too generous, and too much work is bing done.
71+
Examining the code, it is clear that the upper bounds on the `loop` variables are far too generous, and too much work is being done.
7272

7373

7474
The solution below tightens the bounds and pre-calculates `c * c` in the outer `loop`.
@@ -171,7 +171,7 @@ def triplets_with_sum(number):
171171
If we could be sure that the code only had to handle small values of `n`, a quadratic method would have the advantage of clarity.
172172

173173
However, the test suite goes up to 30_000, and the online test runner quickly times out.
174-
We therefor need to accept some less readable code and use a linear-time implementation.
174+
We therefore need to accept some less readable code and use a linear-time implementation.
175175

176176
Full details of run-time benchmarking are given in the [Performance article][article-performance].
177177

0 commit comments

Comments
 (0)