Last Page Number
Start Timer
0:00:00
We’re given an ascending string of integers that represents page numbers.
Write a function get_last_page
to return the last page number in the string. If the string of integers is not in the correct page order, return the last number in order.
Example 1:
Input:
input = '12345'
Output:
output = 5
Example 2:
Input:
input = '12345678910111213'
Output:
output = 13
Example 3:
Input:
input = '1235678'
Output:
output = 3
Recommended questions for you
Personalized based on your user activity, skill level, and preferences.
.
.
.
.
.
.
.
.
.
Comments