Thought Process behind the Solution|| C++ || Easy & Clean Code.
Approach\nWhy res Starts at 1\nInitial Smallest Missing Number:\n    The smallest positive integer is 1. Starting res at 1 means we are initially considering 1 
# Approach\n***Why res Starts at 1***\nInitial Smallest Missing Number:\n    The smallest positive integer is 1. Starting res at 1 means we are initially considering 1 as the smallest integer that we can\'t form with the given coins.\n    If we can form 1, we will increment res to 2, meaning we are now considering 2 as the next smallest integer we can\'t form, and so on.\n    \n\n***Let\'s break down the logic:***\n\n- Sort the Coins:\n\nThe coins are sorted in ascending order to ensure that we consider smaller denominations first. This helps us to build the smallest consecutive numbers step by step.\n\n- Iterate Through the Coins:\n\nFor each coin in the sorted list, we check if it can be used to form the current smallest missing number res.\n\n- Check If Coin Can Form res:\n\nIf the coin value a is greater than res, it means we cannot form the number res with the current set of coins, so we break out of the loop.\nIf the coin value a is less than or equal to res, it means we can form the number res and all numbers up to res + a - 1 with the current set of coins. Therefore, we update res to res + a.\n****\n**Example Walkthrough**\n\nConsider coins = [1, 2, 2, 5]:\nInitialization:\nres = 1\n\n**First Iteration (coin = 1):**\ncoin (1) <= res (1)\nUpdate res = res + coin = 1 + 1 = 2\nNow we can form numbers {1}.\n\n**Second Iteration (coin = 2):**\ncoin (2) <= res (2)\nUpdate res = res + coin = 2 + 2 = 4\nNow we can form numbers {1, 2, 3}.\n\n**Third Iteration (coin = 2):**\ncoin (2) <= res (4)\nUpdate res = res + coin = 4 + 2 = 6\nNow we can form numbers {1, 2, 3, 4, 5}.\n\n**Fourth Iteration (coin = 5):**\ncoin (5) > res (6)\nBreak the loop, as we can\'t form res (6) with the current set of coins.\n\nThe maximum number of consecutive integers that can be formed is 5.\n\n# Complexity\n- Time complexity:\nO(nlogn)\n\n- Space complexity:\nO(1)\n\n# Code\n```\nclass Solution {\npublic:\n    int getMaximumConsecutive(vector<int>& coins) {\n        sort(coins.begin(), coins.end());\n        int missing = 1;\n        for (int coin : coins) {\n            if (coin > missing)\n                break;\n            missing += coin;\n        }\n        return missing;\n    }\n};\n```
['Array', 'Greedy', 'Sorting', 'C++']