Problem · Array

Generate Array

Learn this problem
EasyUberFULLTIMEOA
See Uber hiring insights

Problem statement

Given a String array, return the output array in form where each word is first letter of that word with last letter of next (i+1)th index word.

eg = ["cat","dog","flower","bed"]

Output = ["cg","dr","fd","bt"]

Hi! Uber assessment comes with 4 coding questions.

Function

generateArray(words: String[]) → String[]

Examples

Example 1

words = ["cat", "dog", "flower", "bed"]return = ["cg", "dr", "fd", "bt"]
:)

More Uber problems

drafts saved locally
public String[] generateArray(String[] words) {
  // write your code here
}
words["cat", "dog", "flower", "bed"]
expected["cg", "dr", "fd", "bt"]
checking account