Skip to content

Latest commit

 

History

History
28 lines (18 loc) · 489 Bytes

README.md

File metadata and controls

28 lines (18 loc) · 489 Bytes

Look and Say

This problem was asked by Epic.

Description

The "look and say" sequence is defined as follows: beginning with the term 1, each subsequent term visually describes the digits appearing in the previous term.

The first few terms are as follows:

1 11 21 1211 111221

As an example, the fourth term is 1211, since the third term consists of one 2 and one 1.

Given an integer N, return the Nth term of this sequence.

Example

Input:
  N: 5

Output: "111221"