Easy to understand Sol for beginners
Intuition\n Describe your first thoughts on how to solve this problem. \n1. to_string function to convert the integer to string for concatenation.\n2. stoi() to
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n1. to_string function to convert the integer to string for concatenation.\n2. stoi() to convert string back into integer.\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n1. Iterating over the first half of the nums vector and concatenating the values at each index(i) with the corresponding value at the opposite end of the vector(n-1-i). This concatenated value is then converted to an integer and added to sum.\n2. If n is odd, the value of nums[n/2] is added to sum.\n3. Finally, sum is returned as the result of the function\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\nO(n)\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\nO(1)\n\n# Code\n```\nclass Solution {\npublic:\n    long long findTheArrayConcVal(vector<int>& nums) {\n        long sum=0;\n        int n=nums.size();\n        for(int i=0;i<n/2;i++)\n        {\n            string res= to_string(nums[i]) + to_string(nums[n-1-i]);\n            sum+=stoi(res);\n        }\n        if(n%2!=0)\n        {\n            sum+=nums[n/2];\n        }\n    return sum;\n    }\n};\n```
['C++']