Tap here to switch tabs
Problem
Submissions

Problem: Sorting the Sentence

med
30 min
Try to solve the Sorting the Sentence problem.

Statement

A sentence is a sequence of words separated by single spaces. Each word has a 11 indexed value from 11 to 99 appended to its end, representing its original position in the sentence.

Given a shuffled sentence s, reconstruct and return the original sentence by ordering the words according to their appended positions and removing the numbers.

Constraints:

  • 2≤2 \leq s.length ≤200\leq 200

  • s consists of lowercase and uppercase English letters, spaces, and digits from 11 to 99.

  • The number of words in s is between 11 and 99.

  • The words in s are separated by a single space.

  • s contains no leading or trailing spaces.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Sorting the Sentence

med
30 min
Try to solve the Sorting the Sentence problem.

Statement

A sentence is a sequence of words separated by single spaces. Each word has a 11 indexed value from 11 to 99 appended to its end, representing its original position in the sentence.

Given a shuffled sentence s, reconstruct and return the original sentence by ordering the words according to their appended positions and removing the numbers.

Constraints:

  • 2≤2 \leq s.length ≤200\leq 200

  • s consists of lowercase and uppercase English letters, spaces, and digits from 11 to 99.

  • The number of words in s is between 11 and 99.

  • The words in s are separated by a single space.

  • s contains no leading or trailing spaces.