Tap here to switch tabs
Problem
Submissions

Problem: Check if Numbers Are Ascending in a Sentence

med
30 min
Try to solve the Check if Numbers Are Ascending in a Sentence problem.

Statement

A sentence is a sequence of tokens separated by single spaces, containing no leading or trailing spaces. Each token is either a word consisting of lowercase English letters or a positive integer consisting of digits from 00 to 99 without leading zeros.

Given a string s representing a sentence, determine whether all the integers in s appear in strictly increasing order from left to right (meaning every integer is strictly greater than the integer preceding it).

Return true if all integers in s are strictly increasing, or false otherwise.

Constraints:

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

  • s consists of lowercase English letters, spaces, and digits from 00 to 99, inclusive.

  • The number of tokens in s is between 22 and 100100, inclusive.

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

  • There are at least 22 numbers in s.

  • Each number in s is a positive number less than 100100, with no leading zeros.

  • s contains no leading or trailing spaces.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Check if Numbers Are Ascending in a Sentence

med
30 min
Try to solve the Check if Numbers Are Ascending in a Sentence problem.

Statement

A sentence is a sequence of tokens separated by single spaces, containing no leading or trailing spaces. Each token is either a word consisting of lowercase English letters or a positive integer consisting of digits from 00 to 99 without leading zeros.

Given a string s representing a sentence, determine whether all the integers in s appear in strictly increasing order from left to right (meaning every integer is strictly greater than the integer preceding it).

Return true if all integers in s are strictly increasing, or false otherwise.

Constraints:

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

  • s consists of lowercase English letters, spaces, and digits from 00 to 99, inclusive.

  • The number of tokens in s is between 22 and 100100, inclusive.

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

  • There are at least 22 numbers in s.

  • Each number in s is a positive number less than 100100, with no leading zeros.

  • s contains no leading or trailing spaces.