1class Solution {2 public:3 int minNumberOperations(vector<int> &target) {4 int n = target.size();5 int pre = 0, cnt = 0;6 for (int i = 0; i < n; i++) {7 if (target[i] > pre) cnt += target[i] - pre;8 pre = target[i];9 }10 return cnt;11 }12};
WPM •0 •0
ACC •0 •0
TIME •0