Tap here to switch tabs
Problem
Submissions

Problem: Shortest String That Contains Three Strings

med
30 min
Try to solve the Shortest String That Contains Three Strings problem.

Statement

Given three strings a, b, and c, determine the shortest string that contains all three given strings as substrings.

If there are multiple valid strings of the same minimum length, return the lexicographically smallest one.

Constraints:

  • 1≤1 \leq a.length, b.length, c.length ≤100\leq 100

  • a, b, and c consist only of lowercase English letters.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Shortest String That Contains Three Strings

med
30 min
Try to solve the Shortest String That Contains Three Strings problem.

Statement

Given three strings a, b, and c, determine the shortest string that contains all three given strings as substrings.

If there are multiple valid strings of the same minimum length, return the lexicographically smallest one.

Constraints:

  • 1≤1 \leq a.length, b.length, c.length ≤100\leq 100

  • a, b, and c consist only of lowercase English letters.