Problem · String

Interleave Equal-Length Strings by Column

Learn this problem
EasyUpstartFULLTIMEOA

Problem statement

Given three equal-length strings, build a new string by taking the character at index 0 from all three strings, then the character at index 1 from all three strings, and so on.

Function

interleaveStrings(first: String, second: String, third: String) → String

Examples

Example 1

first = "abc"second = "def"third = "ghi"return = "adgbehcfi"

Reading each column produces adg, then beh, then cfi.

More Upstart problems

drafts saved locally
public String interleaveStrings(String first, String second, String third) {
  // write your code here
}
first"abc"
second"def"
third"ghi"
expected"adgbehcfi"
checking account