My solution
Code
# Code
```rust []
impl Solution {
    pub fn maximum_amount(coins: Vec<Vec<i32>>) -> i32 {
    let rows = coins.len();
    let cols = coins[0].len();
    let mut memory = vec![[i32::MIN; 3]; rows];

    memory[rows - 1] = [0; 3];

    *(0..cols).rev().fold(memory, |mut mem, col| {
        for row in (0..rows).rev() {
            let pos_mon = coins[row][col];
            for neu_rem in 0..=2 {
                if neu_rem == 2 {
                    mem[row][neu_rem] = pos_mon
                        + mem[row][neu_rem]
                            .max(mem.get(row + 1).map(|v| v[neu_rem]).unwrap_or(i32::MIN));
                } else {
                    mem[row][neu_rem] = (pos_mon
                        + mem[row][neu_rem]
                            .max(mem.get(row + 1).map(|v| v[neu_rem]).unwrap_or(i32::MIN)))
                    .max(
                        pos_mon.max(0)
                            + mem[row][neu_rem + 1]
                                .max(mem.get(row + 1).map(|v| v[neu_rem + 1]).unwrap_or(i32::MIN)),
                    );
                }
            }
        }
        mem
    })[0]
        .iter()
        .max()
        .unwrap()
    }
}
```
['Rust']