update: slice exercises 21, 23, 24, 25, 26
This commit is contained in:
17
16-slices/exercises/21-correct-the-lyric/hints.md
Normal file
17
16-slices/exercises/21-correct-the-lyric/hints.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# Hints
|
||||
|
||||
You can use the following slice operations to solve the exercise:
|
||||
|
||||
+ Prepends "value" to the slice:
|
||||
```go
|
||||
slice = append([]string{"value"}, slice...)
|
||||
```
|
||||
|
||||
+ Appends some part (N to M) of the same slice to itself:
|
||||
```go
|
||||
slice = append(slice, slice[N:M]...)
|
||||
```
|
||||
+ Copies the last part of the slice starting from M to the first part of the slice until N:
|
||||
```go
|
||||
slice = append(slice[:N], slice[M:]...)
|
||||
```
|
@@ -51,18 +51,7 @@ import (
|
||||
//
|
||||
// HINTS
|
||||
//
|
||||
// Only look at this if you get stuck.
|
||||
//
|
||||
// You can use the following slice operations to solve the exercise.
|
||||
//
|
||||
// + Prepends "value" to the slice:
|
||||
// slice = append([]string{"value"}, slice...)
|
||||
//
|
||||
// + Appends some part (N to M) of the same slice to itself:
|
||||
// slice = append(slice, slice[N:M]...)
|
||||
//
|
||||
// + Copies the last part of the slice starting from M to the first part of the slice until N:
|
||||
// slice = append(slice[:N], slice[M:]...)
|
||||
// If you get stuck, check out the hints.md file.
|
||||
//
|
||||
// ---------------------------------------------------------
|
||||
|
||||
|
Reference in New Issue
Block a user