LeetCode #2529

Maximum Count of Positive Integer and Negative Integer

1개의 풀이 · C++

문제 원문 보기 ↗

SOLUTION INFO

C++ · main.cpp

main.cpp
class Solution {
public:
    int maximumCount(vector<int>& nums) {
        int l = lower_bound(nums.begin(), nums.end(), 0) - nums.begin();
        int r = nums.end() - upper_bound(nums.begin(), nums.end(), 0);
        return max(l, r);
    }
};

SOLUTION DESCRIPTION

풀이 설명

등록된 풀이 설명이 없습니다.