Ctrl K

Climbing Numbers in a Note

Easy
A note note is made of words and numbers separated by single spaces, with no leading or trailing spaces. Each token is either a word of lowercase English letters or a positive integer without leading zeros. Check that the numbers in the note, read from left to right, are **strictly increasing**: each number is smaller than the next number after it. Return True if so, and False otherwise.
Example 1
note="left 3 crates and 8 boxes then 15 bags" → True

The numbers are 3, 8, 15 — each one is larger than the one before.

Example 2
note="buy 4 eggs 2 lemons 9 apples" → False

2 comes after 4, so the numbers stop climbing.

Example 3
note="room 12 then room 12" → False

12 and 12 are equal, but the climb must be strict.

Constraints
  • 1 ≤ len(note) ≤ 200
  • Tokens are separated by exactly one space, with none at the start or end
  • Each token is a word of lowercase English letters or a positive number without leading zeros
Have you seen this problem in a real interview?
Solved by0
Tried by0
Submissions0
Acceptance—
Topics
Similar problemsValue of a Roman Numeral EasyShared Start of Words EasyBracket Balance EasyWhere the Fragment Starts EasyLength of the Final Word Easy
loading Python…
Input
note="left 3 crates and 8 boxes then 15 bags"
Expected
True

Run checks the first 3 tests in your browser. Submit checks all 202 tests on the server, hidden ones included.