4 ms·
According to wikipedia[1], the sequence goes 1, 11, 21, 1211, 111221, 312211, 13112221, 1113213211, ... [1] http://en.wikipedia.org/wiki/Look-and-say_sequence
by gmt2027 14y ago
According to wikipedia[1], the sequence goes
1, 11, 21, 1211, 111221, 312211, 13112221, 1113213211, ...
[1] http://en.wikipedia.org/wiki/Look-and-say_sequence http://en.wikipedia.org/wiki/Look-and-say_sequence
- tubs 14y agoAye, but the L-system still fits given the amount of data shown in the question. So is the L-system incorrect, because there's no way to disambiguate the sequence given the data?
- raverbashing 14y agoI think you're right on the money Your major problem would be finding an interviewer who knows what's an L-System Edit: you should add the rule 111->31, so it may not be an l-system because there are infinite rules? (1111->41), etc Or we limit it up to digit 9
- PeterisP 14y agoThe whole point is that the provided data supports many different completely valid sequences - unless that specific 'look-and-say' is very common in the company problem domain, there are multiple valid answers. That's an issue with any sequence-style problems.