-
Notifications
You must be signed in to change notification settings - Fork 519
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update instructions append for anagram (#1848)
- Remove some performance considerations. These are basically giving away the implementation. Also, not every student might want to focus on performance. Such considerations may be better suited for approaches articles. - Remove non-Rust-related hints. These are pretty much covered by the instructions. I guess these were lacking at some point, but updated in the meantime. - Move the most important hint about lifetimes to the top.
- Loading branch information
Showing
2 changed files
with
7 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
## General | ||
|
||
The solution is case insensitive, which means `"WOrd"` is the same as `"word"` or `"woRd"`. | ||
It may help to take a peek at the [std library](https://doc.rust-lang.org/std/primitive.char.html) for functions that can convert between them. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,4 @@ | ||
# Hints | ||
# Instructions append | ||
|
||
The solution is case insensitive, which means `"WOrd"` is the same as `"word"` or `"woRd"`. It may help to take a peek at the [std library](https://doc.rust-lang.org/std/primitive.char.html) for functions that can convert between them. | ||
|
||
The solution cannot contain the input word. A word is always an anagram of itself, which means it is not an interesting result. Given `"hello"` and the list `["hello", "olleh"]` the answer is `["olleh"]`. | ||
|
||
You are going to have to adjust the function signature provided in the stub in order for the lifetimes to work out properly. This is intentional: what's there demonstrates the basics of lifetime syntax, and what's missing teaches how to interpret lifetime-related compiler errors. | ||
|
||
Try to limit case changes. Case changes are expensive in terms of time, so it's faster to minimize them. | ||
|
||
If sorting, consider [sort_unstable](https://doc.rust-lang.org/std/primitive.slice.html#method.sort_unstable) which is typically faster than stable sorting. When applicable, unstable sorting is preferred because it is generally faster than stable sorting and it doesn't allocate auxiliary memory. | ||
You are going to have to adjust the function signature provided in the stub in order for the lifetimes to work out properly. | ||
This is intentional: what's there demonstrates the basics of lifetime syntax, and what's missing teaches how to interpret lifetime-related compiler errors. |