Tap here to switch tabs
Problem
Submissions

Problem: Split Concatenated Strings

Split Concatenated Strings lets you reverse any chosen strings, concatenate them in their original order as a circle, and cut it anywhere to return the largest possible linear string.

Statement

You are given an array of strings strs. You can arbitrarily choose to reverse any number of strings in strs. After making these choices, concatenate all strings in their original order into a circular string where the end of the last string connects to the beginning of the first string.

You can then make a single cut at any character position within this circular string to obtain a linear string by reading the characters in order starting from the cut.

Return the lexicographically largest string that can be produced.

Constraints:

  • 1≤1 \leq strs.length ≤1000\leq 1000

  • 1≤1 \leq strs[i].length ≤1000\leq 1000

  • 1≤∑(1 \leq \sum( strs[i].length )≤1000) \leq 1000

  • strs[i] consists of lowercase English letters.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Split Concatenated Strings

Split Concatenated Strings lets you reverse any chosen strings, concatenate them in their original order as a circle, and cut it anywhere to return the largest possible linear string.

Statement

You are given an array of strings strs. You can arbitrarily choose to reverse any number of strings in strs. After making these choices, concatenate all strings in their original order into a circular string where the end of the last string connects to the beginning of the first string.

You can then make a single cut at any character position within this circular string to obtain a linear string by reading the characters in order starting from the cut.

Return the lexicographically largest string that can be produced.

Constraints:

  • 1≤1 \leq strs.length ≤1000\leq 1000

  • 1≤1 \leq strs[i].length ≤1000\leq 1000

  • 1≤∑(1 \leq \sum( strs[i].length )≤1000) \leq 1000

  • strs[i] consists of lowercase English letters.