Efficiently Concatenating and Summing Integers in JavaScript with two Approaches
\n# Algorithm 1: Using String Conversion\n\n/**\n * @param {number[]} nums\n * @return {number}\n */\nvar findTheArrayConcVal = function(nums) {\n    let ans = 
\n# Algorithm 1: Using String Conversion\n```\n/**\n * @param {number[]} nums\n * @return {number}\n */\nvar findTheArrayConcVal = function(nums) {\n    let ans = 0;\n    let left = 0, right = nums.length-1;\n    while(left <= right){\n        if(left !== right){\n            let n = countDigits(nums[left]);\n            let m = countDigits(nums[right]);\n            ans += nums[left] * Math.pow(10, m) + nums[right];\n        }else{\n            ans += nums[left];\n        }\n        left++, right--;\n    }\n\n    return ans;\n};\n\nfunction countDigits(num) {\n    let count = 0;\n    while (num !== 0) {\n        num = Math.floor(num / 10);\n        count++;\n    }\n    return count;\n}\n\n```\n# Algorithm 2: Using Math\n```\nvar findTheArrayConcVal = function(nums) {\n    let ans = 0;\n    let left = 0, right = nums.length-1;\n    while(left <= right){\n        if(left !== right){\n            let strNum = nums[left].toString() + nums[right].toString()\n            let num = parseInt(strNum)\n            ans += num;\n        }else{\n            ans +=nums[left];\n        }\n        left++, right--;\n    }\n\n    return ans;\n};\n```
['Two Pointers', 'TypeScript', 'JavaScript']