Question: Write a function in Python: When given a list, the function returns the largest increase from one item to the next item and the last

  • Write a function in Python:
    • When given a list, the function returns the largest increase from one item to the next item and the last duplicate numbers in a row.

  • Sample of what is meant:

Given: nums1 = [2, 4, 4, 1, 8, 8, 10]

Returns 7 for the largest increase and 8 for the last duplicate numbers in a row.

Given: nums2 = [500, 500, 400, 800, 900, 900, 1500, 700]

Returns 600 for the largest increase and 900 for the last duplicate numbers in a row.

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!