Skip to content

Practice Find the Array Concatenation Value

Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.

Easy#2562
LeetCode Problem

Find the Array Concatenation Value

Problem Statement

Start a total at 0. While nums has at least two entries, concatenate the decimal representation of its first entry followed by its last, add that integer to the total, and remove both. If one entry remains, add it directly. Return the final total.

Source: Find the Array Concatenation Value on LeetCode. Use the original task for its coding environment and submissions.

Examples

# Example 1

Input
nums = [7,52,2,4]
Output
596

# Example 2

Input
nums = [5,14,13,8,12]
Output
673

Constraints

1 <= nums.length <= 1000
1 <= nums[i] <= 10^4

Related LeetCode Problems

Practice more problems similar to Find the Array Concatenation Value.

Review your practice with PhantomCodeAI

After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.