5. Join Array Elements

Given an integer array a. Write a function string Join(int[] a) that concatenates all array elements into one string.
Example 1
Input: a = [1, 2, 3]
Output: "123"
Explanation: All numbers are concatenated into a single string without separators
Example 2
Input: a = []
Output: ""
Explanation: An empty array is converted to an empty string
Example 3
Input: a = [42]
Output: "42"
Explanation: A single-element array is converted to a string
arrayseasystrings
JavaScript
Loading...
Line 1, Char 1