Learn
Exam

String Addition

Difficulty
STARTER

Problem

Given two strings word1 and word2, write a function solution that returns the result of concatenating the two strings.


Constraints

  • word1 and word2 consist only of lowercase English letters.
  • The lengths of word1 and word2 are between 1 and 100 inclusive.

Test Case

Test Case Number word1 word2 return
1 "hello" "world" "helloworld"
2 "abc" "def" "abcdef"
3 "java" "script" "javascript"

Explanation for Test Case 1

  • When word1 = "hello" and word2 = "world", the result of concatenating the two strings is "helloworld".

Explanation for Test Case 2

  • When word1 = "abc" and word2 = "def", the result of concatenating the two strings is "abcdef".

Explanation for Test Case 3

  • When word1 = "java" and word2 = "script", the result of concatenating the two strings is "javascript".