Posted on

Description

Submission

class Solution {
public:
    int search(vector<int>& nums, int target) {
        return upper_bound(nums.begin(), nums.end(), target) 
            - lower_bound(nums.begin(), nums.end(), target);
    }
};

Leave a Reply

Your email address will not be published. Required fields are marked *