Tap here to switch tabs
Problem
Submissions

Problem: Concatenate Array With Reverse

Concatenate Array With Reverse asks you to return a new array containing the original integers followed by the same integers in reverse order, doubling the input length.

Statement

Given an integer array nums of length n, return an array ans of length 2n2n formed by appending the elements of nums in reverse order to the end of nums.

Constraints:

  • 1≤1 \leq nums.length ≤100\leq 100

  • 1≤1 \leq nums[i] ≤100\leq 100

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Concatenate Array With Reverse

Concatenate Array With Reverse asks you to return a new array containing the original integers followed by the same integers in reverse order, doubling the input length.

Statement

Given an integer array nums of length n, return an array ans of length 2n2n formed by appending the elements of nums in reverse order to the end of nums.

Constraints:

  • 1≤1 \leq nums.length ≤100\leq 100

  • 1≤1 \leq nums[i] ≤100\leq 100