Project Euler problem 67: find maximum cost path in 100-row triangle

前端 未结 5 1235
长情又很酷
长情又很酷 2021-02-11 06:27

In Project Euler\'s problem 67 there is a triangle given and it contains 100 rows. For e.g.

        5
      9  6
    4   6  8
  0   7  1   5

I.e. 5 + 9 + 6 + 7          


        
5条回答
  •  悲&欢浪女
    2021-02-11 07:08

    Which language are you using?

    A muti-dimensional array is probably the best way to store the values, then depending on the language, there are options for how you store pointers or references to where in the arrays you are.

提交回复
热议问题