반응형
고대로 해주면 된다.
class Solution {
public:
int busyStudent(vector<int>& startTime, vector<int>& endTime, int queryTime) {
int ans =0;
for(int i = 0;i<startTime.size();i++)
if(startTime[i]<= queryTime && endTime[i]>= queryTime)
ans++;
return ans;
}
};
반응형
'IT > 알고리즘' 카테고리의 다른 글
22] Leetcode 1446. Consecutive Characters (0) | 2020.07.03 |
---|---|
21] Leetcode 657. Robot Return to Origin (0) | 2020.07.01 |
19★] Leetcode 1436. Destination City (0) | 2020.06.30 |
18] Leetcode 1475. Final Prices With a Special Discount in a Shop (0) | 2020.06.29 |
17] Leetcode 1323. Maximum 69 Number (0) | 2020.06.29 |
댓글