r/dailyprogrammer • • Feb 17 '12

[2/17/2012] Challenge #9 [difficult]

The U.S government has commissioned you to catch the terrorists!

There is a mathematical pyramid with the following pattern:

1

11

21

1211

111221

312211

you must write a program to calculate up to the 40th line of this pyramid. If you don't, the terrorists win!

6 Upvotes

31 comments sorted by

View all comments

Show parent comment

3

u/FataOne 0 0 Feb 17 '12

I would argue that pattern recognition can be an exceptionally useful tool in programming so I'm glad the OP didn't outright explain it. Keeping it hidden in this top comment is probably a pretty good route to take.