The stack containing the main function

title description

defines the data structure of the stack, please implement a min function in this type that can get the smallest element contained in the stack (time complexity should be O(1)) .

class Solution {
public:
vector<int> num;
	vector<int> minEle;
    void push(int value) {
    	num.push_back(value);

    	if(minEle.size()<1)
    		minEle.push_back(value);
    	else
    		minEle.push_back(value < minEle[minEle.size()-1]?value:minEle[minEle.size()-1]);     
    }
    void pop() {
        int end = num[num.size()-1];
        num.pop_back();
        minEle.pop_back();
    }
    int top() {
        return minEle[minEle.size()-1];
    }
    int min() {
        return top();
    }
};