We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2143db1 commit 1cfd39aCopy full SHA for 1cfd39a
15/1.cpp
@@ -3,7 +3,7 @@
3
using namespace std;
4
5
// 값이 [left_value, right_value]인 데이터의 개수를 반환하는 함수
6
-int countByRange(vector<int> v, int leftValue, int rightValue) {
+int countByRange(vector<int>& v, int leftValue, int rightValue) {
7
vector<int>::iterator rightIndex = upper_bound(v.begin(), v.end(), rightValue);
8
vector<int>::iterator leftIndex = lower_bound(v.begin(), v.end(), leftValue);
9
return rightIndex - leftIndex;
0 commit comments