最近看有關google的書,看到一些有趣的問題。引起我寫著個專欄的興趣。以後會陸續鼻定期推出一些有趣的題目。(題目的作者都不是我)並提供解答與相關連結。

以下就是一題:
1
1 1
2 1
1 2 1 1
1 1 1 2 2 1

下一行是什麼? What's next line?

[hint: 用英文念念以上的數字]

From : MIT Technology Review by Google



------------------------------------------------------------------------

Ans:[ 31221]

說明:
1
1 1 (one one => 1個1)
2 1 ( Two one => 2個1)
1 2 1 1 (one two one one =>1個2 , 1個1)
1 1 1 2 2 1 (one one one two two one =>1個1 , 1個2, 2個1)
(three one two two one one =>3個1 , 2個2, 1個1) =>[31221]