Tap here to switch tabs
Problem
Submissions

Problem: Lexicographically Largest String From the Box I

Lexicographically Largest String From the Box I asks you to split a string into a fixed number of nonempty contiguous parts and return the lexicographically largest substring from any valid split.

Statement

You are given a string word and an integer numFriends.

The string word is split into numFriends non empty contiguous substrings such that concatenating them in order produces word.

Return the lexicographically largest substring that can appear among all possible valid splits.

Constraints:

  • 1≤1 \leq word.length ≤5×103\leq 5 \times 10^3

  • word consists only of lowercase English letters.

  • 1≤1 \leq numFriends ≤\leq word.length

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Lexicographically Largest String From the Box I

Lexicographically Largest String From the Box I asks you to split a string into a fixed number of nonempty contiguous parts and return the lexicographically largest substring from any valid split.

Statement

You are given a string word and an integer numFriends.

The string word is split into numFriends non empty contiguous substrings such that concatenating them in order produces word.

Return the lexicographically largest substring that can appear among all possible valid splits.

Constraints:

  • 1≤1 \leq word.length ≤5×103\leq 5 \times 10^3

  • word consists only of lowercase English letters.

  • 1≤1 \leq numFriends ≤\leq word.length