Java 0ms beats 100%
\n# Complexity\n- Time complexity: O(n)\n\n- Space complexity: O(1)\n\n# Code\n\nclass Solution {\n    public long findTheArrayConcVal(int[] nums) {\n\n        
\n# Complexity\n- Time complexity: O(n)\n\n- Space complexity: O(1)\n\n# Code\n```\nclass Solution {\n    public long findTheArrayConcVal(int[] nums) {\n\n        long sum = 0;  // what we\'ll return\n        int idxLeft = 0;\n        int idxRight = nums.length - 1;\n\n        while (idxLeft < idxRight) {\n            sum += getConcatenationValue(nums[idxLeft], nums[idxRight]);\n            ++idxLeft;\n            --idxRight;\n        }\n\n        if (idxLeft == idxRight) {\n            sum += nums[idxLeft];\n        }\n\n        return sum;\n    }\n\n    private long getConcatenationValue(int leftVal, int rightVal) {\n\n        long left = leftVal;\n        long right = rightVal;\n\n        // right == 10000\n        if (right == 10000) {\n            return left * 100000L + right;\n        }\n\n        // 9999 >= right >= 1000\n        if (right >= 1000) {\n            return left * 10000L + right;\n        }\n\n        // 999 >= right >= 100\n        if (right >= 100) {\n            return left * 1000L + right;\n        }\n        \n        // 99 >= right >= 10\n        if (right >= 10) { \n            return left * 100L + right;\n        }\n\n        // 9 >= right >= 1\n        return left * 10L + right;\n    }\n\n}\n```
['Java']