Optimized simple solution - beats 95.78%🔥
Complexity
Time complexity: O(N)

Space complexity: O(1)
Code
# Complexity
- Time complexity: O(N)
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity: O(1)
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```java []
class Solution {
    public long findTheArrayConcVal(int[] nums) {
        long ans = 0;

        int l = 0;
        int r = nums.length - 1;

        while (l < r) {
            int n1 = nums[l];
            int n2 = nums[r];
            int t = n2;
            int p = 10;
            while (t != 0) {
                t /= 10;
                p *= 10;
            }
            if (p != 10) {
                ans += n1 * p / 10 + n2; 
            }
            l++;
            r--;
        }

        if (l == r) {
            ans += nums[l];
        }

        return ans;
    }
}
```
['Java']