TypeScript solution, beats 100%
IntuitionWe can solve this problem with O(n/2)ApproachWe need to iterate through a half of the array.
Starting from 0 and picking values: left = nums[0], right
# Intuition

We can solve this problem with O(n/2)

# Approach

We need to iterate through a half of the array.
Starting from 0 and picking values: left = nums[0], right = nums[nums.length - 1 - 0].
Then iterate until we calculate all the elements.

# Complexity

# Time complexity:

O(n)
(O(n/2) to be precise)


# Code
```typescript []
function findTheArrayConcVal(nums: number[]): number {
  let result = 0;
  for (let i = 0; i < Math.ceil(nums.length / 2); i++) {
    const left = nums[i];
    const rightIndex = nums.length - 1 - i;

    if (rightIndex === i) {
      result += left;
      continue;
    }

    const concatenated = Number.parseInt(left.toString() + nums[rightIndex].toString());
    result += concatenated;
  }

  return result;
}

```
['TypeScript']