Company: sapient_27sep
Difficulty: medium
Collect Maximum Coins Problem Description In a new online game, players navigate a 2 x n matrix. Each cell (r, c) initially contains a certain number of coins. The number of coins in a cell changes over time - at time t, the cell at position (r, c) contains (r + 1) * (c + 1) * t coins. A player must: Start from position (0, 0) at time t = 0 Move to a neighboring cell in one unit of time Visit each cell exactly once Collect all coins in visited cells Determine the maximum number of coins a player can collect. Function Description Complete the getMaxCoins function in the editor, with the following parameter(s): long getMaxCoins(int coins_rows, int coins_columns, int** coins) coins_rows : number of rows (always 2) coins_columns : number of columns (n) coins[2][2] : the initial number of coins in the matrix. Returns long: the maximum number of coins that can be collected. Examples Example 1: n = 4 coins = [[1, 4, 3, 2], [2, 1, 3, 2]] The optimal path Time | Cell | Coins -----|--------|----