Question: Write A C++ programme with this following instruction Category: Easy You are given a 2D square matrix where each index contains some amount of gold.

Write A C++ programme with this following instruction
Category: Easy You are given a 2D square matrix where each index contains some amount of gold. Currently, you are in the (0, 0) index of the array and you have to go to the (n-1, n-1) index of the array where n represents the size of the array. You can move in two directions only. Right and down. In addition, you can't visit a single place more than once. The amount of goal in (0,0) and (n-1, n-1) is zero (O). You have to answer what is the maximum amount of gold you can pick throughout the way of your journey. The first line of the input represents the value of n. 5 (0, 1) -> (0, 2) -> (0, 3) -> (0, 4) -> (1,4) -> (2, 4) -> (3, 4) -> (4,4)0 + 6 + (-5) + 10 + 9 + 7 + (-1) + 25 + 0 = 51
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
