Question: Write a python function numIncreasing that takes as input a tuple of numbers and returns the first sequence within the tuple that is increasing order
Write a python function numIncreasing that takes as input a tuple of numbers and returns the first sequence within the tuple that is increasing order and has length at least 2.
You can assume such an increasing sequence always exists. For example:
(5, 2, 1, 3, 4) returns (1, 3, 4), because only the latter 3 are in increasing order
(2, 1, 4, 5, 6) returns (1, 4, 5, 6)
(1, 8, 9, 10, 100) returns (1, 8, 9, 10, 100)
(4, 1, 2, 3, 4, 1, 2, 3) returns (1, 2, 3, 4)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
