Learn
Exam

Array Addition

Difficulty
STARTER

Problem

Given two arrays numbers1 and numbers2 consisting of natural numbers, write a function solution that returns the result of combining numbers1 and numbers2.


Constraints

  • Each element in numbers1 and numbers2 is a natural number not exceeding 20.
  • numbers1 and numbers2 are not empty, and each has a length not exceeding 10.

Test Case

Test Case Number numbers1 numbers2 return
1 [1] [2] [1, 2]
2 [2] [1] [2, 1]
3 [1, 2, 3] [4, 5, 6] [1, 2, 3, 4, 5, 6]

Explanation for Test Case 1

  • Combining numbers1 = [1] and numbers2 = [2] results in [1, 2].

Explanation for Test Case 2

  • Combining numbers1 = [2] and numbers2 = [1] results in [2, 1].

Explanation for Test Case 3

  • Combining numbers1 = [1, 2, 3] and numbers2 = [4, 5, 6] results in [1, 2, 3, 4, 5, 6].