You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: 0746-min-cost-climbing-stairs.rs
    path of file: ./repos/NeetCode-Solutions/13_1-D_Dynamic_Programming/02_Min_Cost_Climbing_Stairs
    
    the code of the file until where you have to start completion: /*
Problem: LeetCode 746 - Min Cost Climbing Stairs

Key Idea:
The key idea is to use dynamic programming to find the minimum cost to reach each step.

Approach:
1. Initialize an array `dp` of size n+1 to store the minim
    
    pub fn min_cost_climbing_stairs(cost: Vec<i32>) -> i32 {
        let n = cost.len();
        if n <= 2 {
            return cost.iter().min().unwrap_or(&0).to_owned();
        }

        let mut dp = vec![0; n + 1];

        for i in 2..=n {
            dp[i] = std::cmp::min(dp[i - 1] + cost[i - 1], dp[i - 2] + cost[i - 2]);
        }

        dp[n]
    }