Problem · Array
Match Consecutive Word Boundaries
Learn this problemProblem statement
Given an array of strings words, examine every consecutive pair of words.
Return a boolean array of length words.length - 1. Its ith value is true exactly when words[i] and words[i + 1] start with the same character and end with the same character. Otherwise, it is false.
Function
matchConsecutiveWordBoundaries(words: String[]) → boolean[]Examples
Example 1
words = ["abcd","abdd","da","dd"]return = [true,false,false]The first pair starts with a and ends with d in both words, so its result is true. The second pair starts with different characters, and the third pair ends with different characters.
Example 2
words = ["a","a"]return = [true]The only pair has the same first and last character.
Constraints
1 <= words.length <= 1001 <= words[i].length <= 100- Every word contains only lowercase English letters.
More Capital One problems
- Compare Counts Around PivotOA · Seen Jul 2026
- Format a Newspaper PageOA · Seen Jul 2026
- Laser Robot Safe PathOA · Seen Jul 2026
- Reconstruct Landmark JourneyOA · Seen Jul 2026
- Rightmost Longest Character RunOA · Seen Jul 2026
- Track Received Byte RangesOA · Seen Jul 2026
- Alternate String EndsOA · Seen Jul 2026
- Round-Robin WDL OrderOA · Seen Jul 2026