[Rust] Sort + Greedy value coverage extension
Intuition\nThe intuition behind solving this problem is based on the realization that if we can create every sum up to a certain value with the given coins, the
# Intuition\nThe intuition behind solving this problem is based on the realization that if we can create every sum up to a certain value with the given coins, then any additional coin can only increase or maintain this range. The key lies in identifying the smallest value that we cannot attain. Since the coins don\'t necessarily come in a sequence (like 1, 2, 3, etc.), there might be gaps. Our goal is to find the first gap in the consecutive sums that we can create.\n\n# Approach\n1. **Sort the Coins:** Start by sorting the coins in ascending order. This step is crucial as it allows us to methodically build up sums from the smallest coin upwards, ensuring we don\'t miss any possible sums.\n\n2. **Iterative Summation:**\n   - Initialize a variable `cover` to 0, which represents the highest sum we can create consecutively from the given coins.\n   - Iterate through the sorted coins. For each coin, check if the next coin is larger than `cover + 1`. If it is, this means we cannot create the sum `cover + 1` with the given coins, and hence we\'ve found our gap.\n   - If the coin is equal to or less than `cover + 1`, add it to `cover`. This increases the range of sums we can create.\n\n3. **Result:**\n   - Once the first gap is found (or if all coins are used), the result is `cover + 1`, which is the smallest sum we cannot create.\n\n# Complexity\n- Time Complexity: **O(n log n)**\n  - The most time-consuming operation in this algorithm is the sorting of the coins, which takes O(n log n) time, where `n` is the number of coins. The subsequent linear scan of the sorted array is O(n), which is overshadowed by the sorting step.\n\n- Space Complexity: **O(1)**\n  - The space complexity is constant. We only use a few variables (`cover` and iteration variables) and do not allocate any additional data structures that scale with the input size. The sorting is done in place, so no extra space is needed for that operation.\n\n# Code\n```\n// Define a struct named Solution. This is a common pattern in competitive programming where\n// functions are defined as static methods on a struct.\nimpl Solution {\n    // Define a public static method on the Solution struct.\n    // It takes a vector of integers as input and returns an integer.\n    pub fn get_maximum_consecutive(coins: Vec<i32>) -> i32 {\n        // Create a mutable copy of the coins vector. \'mut\' keyword is used for mutability.\n        let mut vals = coins;\n        // Sort the vector in-place. Rust\'s sort method is similar to C++\'s sort() and Python\'s sort().\n        vals.sort();\n        \n        // Initialize a variable \'cover\' to 0. It will keep track of the highest consecutive integer\n        // we can make with the given set of coins.\n        let mut cover = 0;\n        \n        // Iterate over the sorted coin values.\n        for val in vals {\n            // Check if the next coin is larger than the smallest unattainable value (cover + 1).\n            // If it is, we can\'t cover that value with the current set of coins, so break the loop.\n            if cover + 1 < val {\n                break;\n            }\n            // Add the current coin\'s value to the cover. This extends the range of consecutive\n            // values we can create.\n            cover += val;\n        }\n        \n        // Return the smallest unattainable value, which is one more than the current cover.\n        cover + 1\n    }\n}\n\n```
['Rust']