allcoding1
27.7K subscribers
2.2K photos
2 videos
77 files
852 links
Download Telegram
👍2
You are give a list Integers, and your task is


Python 3
👍1
Python 3
👍1
Python 3
👍2
C++
👍2
#include <iostream>
#include <vector>

using namespace std;

long makePowerNondecreasing(vector<int>& power) {
    int n = power.size();
    long adjustments = 0;

    for (int i = 1; i < n; ++i) {
        if (power[i] < power[i - 1]) {
            adjustments += power[i - 1] - power[i];
        }
    }

    return adjustments;
}

Amazon

Telegram:- @allcoding1
👍1