

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 4
click for more info
Not enough gems
Cost: 6 gems
1: Arrays in Go
incomplete
2: Slices in Go
incomplete
3: Slices Review
incomplete
4: Make
incomplete
5: Len and Cap Review
incomplete
6: Variadic
incomplete
7: Append
incomplete
8: Range
incomplete
9: Slice of Slices
incomplete
10: Tricky Slices
incomplete
11: Message Filter
incomplete
12: Password Strength
incomplete
13: Message Tagger
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
Arrays are fixed-size groups of variables of the same type. For example, [4]string is an array of 4 values of type string.
To declare an array of 10 integers:
var myInts [10]int
or to declare an initialized literal:
primes := [6]int{2, 3, 5, 7, 11, 13}
When our clients don't respond to a message, they can be reminded with up to 2 additional messages.
Complete the getMessageWithRetries function. It takes three strings and returns:
The returned string array contains the original messages. The first is the primary message, the second is the first reminder, and the third is the last reminder.
The integers in the integer array represent the cost of sending each message. The cost of each message is equal to the length of the message, plus the length of any previous messages. For example: