project euler

Christian Harms's picture

Q*Bert chrismas tree puzzle

This is a short coding puzzle with q*bert (who is q*bert?) and an chrismas tree.

the qbert question

qbert chrismas tree coding puzzle
The task: Our 2011 q*bert can only jump down. He start from the top and has to find the path to the bottom of the chrismas tree with collecting the most points available (while jumping left-or-right down). Find the way with the highest sum.

Input:

  1. chrismasTree = [[75],
  2.               [95,64],
  3.             [17,47,82],
  4.           [18,35,87,10],
  5.         [20, 4,82,47,65],
  6.       [19, 1,23,75, 3,34] ]
  7. print qbertRun(chrismasTree)

The sum is 465 - try to solve it with a little program. The brute force method will be possible with this small tree.Read more

Syndicate content