Skip to content

Latest commit

 

History

History
22 lines (15 loc) · 525 Bytes

README.md

File metadata and controls

22 lines (15 loc) · 525 Bytes

look-and-say-sequence

Calculates the nth term of the Look-and-say sequence.

Build and run

$ cargo build
$ target/debug/look-and-say-sequence -n 5
111221

Testing

$ cargo test

Performance

The digits of this sequence grow linearly, and so does the computing power required to process a given step. But because the index to reach requires the computation of all the previous steps, the time complexity of this problem is actually $N!$.