paste.cpp

Anonymous
c_cpp
03/01/2026 6:43 AM
188 B
43
Indexable
// Time Complexity: O(1)
// Memory Complexity: O(1)

class Solution {
public:
    int minCost(int n) {
        return ((n-1)*n)/2;
    }
};
Editor is loading...
Leave a Comment