Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Various spellchecks #2839

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion concepts/time/links.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
{
"url": "https://www.pauladamsmith.com/blog/2011/05/go_time.html",
"description": "Blog Post: Parsing and formating dates/time in Go"
"description": "Blog Post: Parsing and formatting dates/time in Go"
},
{
"url": "https://yourbasic.org/golang/format-parse-string-time-date-example/",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,22 +64,22 @@ same string.

A hash map of type `map[rune]int` is initialized as the frequency counter. The
first string is iterated over and the frequency counter is updated to hold the
number of occurances of each character in the string. Before a character is
number of occurrences of each character in the string. Before a character is
counted in the frequency counter, it's converted to lowercase to account for
case-insensitive strings that should be anagrams (e.g., `foo` and `OOF`).

The second string is then iterated over and the frequency counter is checked to
see if the lowercase version of the character exists in the hash map. If it does
not then the strings cannot possibly be anagrams of one another and the
implementation returns early. Otherwise, the number of occurances of the current
implementation returns early. Otherwise, the number of occurrences of the current
character is decremented and, if the count of that character reaches 0, the
entry is removed from the hash map.

After iterating through both strings and updating the frequency counter the two
strings are anagrams if and only if the frequency counter is empty. That is, all
of the characters that were counted in the first string have been accounted for
when iterating through the second string. If the second string contained a
charater that the first string did not, then the implementation would return
character that the first string did not, then the implementation would return
early as described above. If the second string contained extra characters or
different characters than the first string then we'd have a non-empty hash map
left over at the end signifying a difference between the two strings.
Expand Down
4 changes: 2 additions & 2 deletions exercises/practice/bob/.approaches/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Regardless of the approach used, some things you could look out for include

- Use the [HasSuffix][hassuffix] `string` method instead of checking the last character by index for `?`.

- Don't copy/paste the logic for determining a shout and for determing a question into determing a shouted question.
- Don't copy/paste the logic for determining a shout and for determining a question into determining a shouted question.
Combine the two determinations instead of copying them.
Not duplicating the code will keep the code [DRY][dry].

Expand Down Expand Up @@ -175,7 +175,7 @@ For more information, check the [Answer array approach][approach-answer-array].

## Which approach to use?

Since each approach sometimes gave results slower than the other approaches when benchmarking, which to use could be a matter of stylistic choice.
Since each approach sometimes gave results slower than the other approaches when benchmarking, which to use could be a matter of stylistic choice.

- To compare the performance of the approaches, check out the [Performance article][article-performance].

Expand Down
2 changes: 1 addition & 1 deletion exercises/practice/complex-numbers/.meta/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func getComplex(in interface{}) complexNumber {
}
result = append(result, v)
default:
panic("uknown type")
panic("unknown type")
}
}
return complexNumber{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Bit-shifting

```go
// Package grains is a small library for determing the squares of a number.
// Package grains is a small library for determining the squares of a number.
package grains

import (
Expand Down
2 changes: 1 addition & 1 deletion exercises/practice/grains/.approaches/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ For more information, check the [`math.Pow()` and `big` exponentiation approach]
## Approach: Bit-shifting

```go
// Package grains is a small library for determing the squares of a number.
// Package grains is a small library for determining the squares of a number.
package grains

import (
Expand Down
2 changes: 1 addition & 1 deletion exercises/practice/grep/.meta/example.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func searchFile(pattern, file string, options *options) (output []string) {
return output
}

// getOptions examines flags and nfiles, outputing options.
// getOptions examines flags and nfiles, outputting options.
func getOptions(flags []string, nfiles int) (opt *options) {
opt = &options{}
for _, option := range flags {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Chain of boolean expressions

```go
// Package leap is a small library for determing if the passed in year is a leap year.
// Package leap is a small library for determining if the passed in year is a leap year.
package leap

// IsLeapYear returns if the passed in year is a leap year.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Package leap is a small library for determing if the passed in year is a leap year.
// Package leap is a small library for determining if the passed in year is a leap year.
package leap

// IsLeapYear returns if the passed in year is a leap year.
Expand Down
4 changes: 2 additions & 2 deletions exercises/practice/leap/.approaches/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ For determining that, you will use the [modulus operator][modulus-operator].
## Approach: Chain of Boolean expressions

```go
// Package leap is a small library for determing if the passed in year is a leap year.
// Package leap is a small library for determining if the passed in year is a leap year.
package leap

// IsLeapYear returns if the passed in year is a leap year.
Expand All @@ -26,7 +26,7 @@ For more information, check the [Boolean chain approach][approach-boolean-chain]
## Approach: Maximum of two checks

```go
// Package leap is a small library for determing if the passed in year is a leap year.
// Package leap is a small library for determining if the passed in year is a leap year.
package leap

// IsLeapYear returns if the passed in year is a leap year.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Maximum of two checks

```go
// Package leap is a small library for determing if the passed in year is a leap year.
// Package leap is a small library for determining if the passed in year is a leap year.
package leap

// IsLeapYear returns if the passed in year is a leap year.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# `time.Add()`

```go
// Package leap is a small library for determing if the passed in year is a leap year.
// Package leap is a small library for determining if the passed in year is a leap year.
package leap

import "time"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# `time.YearDay()`

```go
// Package leap is a small library for determing if the passed in year is a leap year.
// Package leap is a small library for determining if the passed in year is a leap year.
package leap

import "time"
Expand Down