String Processing in Python: Look-and-Say Sequence

Publicado el: 13 febrero 2018
en el canal de: LucidProgramming
19,291
336

In this video, we will be considering the so-called "Look-and-Say" sequence. The first few terms of the sequence are:

1, 11, 21, 1211, 111221, 312211, 13112221, 1113213211, ...

To generate a member of the sequence from the previous member, read off the digits of the previous member, counting the number of digits in groups of the same digit. For example:

1 is read off as "one 1" or 11.
11 is read off as "two 1s" or 21.
21 is read off as "one 2, then one 1" or 1211.
1211 is read off as "one 1, one 2, then two 1s" or 111221.
111221 is read off as "three 1s, two 2s, then one 1" or 312211.

More information on the properties of this sequence can be found on the Wikipedia page here:
https://en.wikipedia.org/wiki/Look-an...

We will define the "look-and-say" sequence and also determine a way to generate the nth term in the sequence. We will also code up an implementation in Python that calculates the nth term in the "look-and-say" sequence.

This video is part of a series on string processing and, specifically, on how these problems tend to show up in the context of a technical interview:
http://bit.ly/lp_string

This video is also part of an "Algorithm" series. For more algorithm tutorials:
http://bit.ly/lp_algos

The software written in this video is available at:
https://github.com/vprusso/youtube_tu...

Do you like the development environment I'm using in this video? It's a customized version of vim that's enhanced for Python development. If you want to see how I set up my vim, I have a series on this here:
http://bit.ly/lp_vim

If you've found this video helpful and want to stay up-to-date with the latest videos posted on this channel, please subscribe:
http://bit.ly/lp_subscribe


En esta página del sitio puede ver el video en línea String Processing in Python: Look-and-Say Sequence de Duración hora minuto segunda en buena calidad , que subió el usuario LucidProgramming 13 febrero 2018, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 19,291 veces y le gustó 336 a los espectadores. Disfruta viendo!