Question: problem statement ( you should use only iostream and string header files. ) You are given a string consisting of English uppercase and lowercase letters

problem statement (you should use only iostream and string header files.)
You are given a string consisting of English uppercase and lowercase letters and decimal
numbers. You can create a strictly increasing sequence (SIS) by picking each letter from
the beginning of this string one by one. And this sequence consists of the numbers 0 to 9,
lowercase English letters a to z, and uppercase English letters A to Z in order. If you receive
2648 as input, SIS can be satisfied with just single-digit strings like {2},{4},{6},{8}. And
it also satisfied with two-digit strings like {2,6},{2,4},{2,8},{6,8}, and three-digit strings
like {2,6,8},{2,4,8}. However, strings like {2,6,4,8} cannot satisfy SIS because 4 is less
than 6.
1
Your goal is to find the length of the longest string that satisfies SIS for a given string.
In the case above, your code should print 3 because the longest string that satisfies SIS is 3
characters long. For example, if you receive 1234abcABC as input, all strings will increase
in order from the beginning, and the result should be 10.
Note that consecutive numbers or letters are considered one sequence. For example, input like 00001
should be calculated as {0,1} and printed 2. Even if the result is the same,
there may be various cases that satisfy the longest SIS. The maximum value of the result
that can be printed will be 09(10)+ a z(26)+ A Z(26)=62.
Students can use recursion function in this problem. A recursive function is a function
that solves a problem by calling itself. Functions break a problem into smaller problems and
solve those smaller problems in the same way. This process is repeated until the simplest
form of the problem, i.e. the base case, is reached. The following code is a function that
calculates the factorial with recursive function.
 problem statement (you should use only iostream and string header files.)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!