FunctionRacerProblemsRace

Two String Lists Spell the Same Word

BeginnerStringsPython, JavaScript, TypeScript, Java, C++

Each list holds pieces of a string. Return True if joining the pieces of word1 in order gives the same string as joining the pieces of word2 in order, otherwise False.

Example 1

word1 ["ab","c"]
word2 ["a","bc"]
returns true

Both join to abc.

Example 2

word1 ["a","cb"]
word2 ["ab","c"]
returns false

acb is not abc.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More Strings problems