March 2019
Intermediate to advanced
336 pages
9h 9m
English
The look-and-say sequence is a sequence of integers:

The sequence is generated by counting the digits of the previous number in the group. John Conway initially coined the term look-and-say sequence.
The look-and-say sequence is shown in the following code. The look_say method takes a string as a parameter and returns a look-and-say sequence of integers:
//main package has examples shown// in Go Data Structures and algorithms bookpackage main// importing fmt and strconv packageimport ( "fmt" "strconv")// look_say methodfunc look_say(str string) (rstr string) { var cbyte byte cbyte = str[0] var inc int inc = 1 var i int for i = ...Read now
Unlock full access