Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem statement ( you should use only #include, #include You are given a string consisting of English uppercase and lowercase letters and decimal numbers. You
Problem statement you should use only #include, #include
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 to
lowercase English letters a to z and uppercase English letters A to Z in order. If you receive
as input, SIS can be satisfied with just singledigit strings like And
it also satisfied with twodigit strings like and threedigit strings
like However, strings like cannot satisfy SIS because is less
than
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 because the longest string that satisfies SIS is
characters long. For example, if you receive abcABC as input, all strings will increase
in order from the beginning, and the result should be
Note that consecutive numbers or letters are considered one sequence. For example, input like
should be calculated as and printed 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 a z A Z
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, ie the base case, is reached. The following code is a function that
calculates the factorial with recursive function.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started