Just use STL
\nclass Solution {\npublic:\n    int getSum(int a, int b) {\n        vector<int> v{a,b};\n        return accumulate(begin(v),end(v),0);\n        \n    }\n};\n
```\nclass Solution {\npublic:\n    int getSum(int a, int b) {\n        vector<int> v{a,b};\n        return accumulate(begin(v),end(v),0);\n        \n    }\n};\n```
['C', 'C++']