Skip to content

Commit 3e35697

Browse files
committed
refactor: remove redundant empty check from lowerBoundBinarySearch
This check isn't needed because the return statement already accounts for empty input.
1 parent c2a8283 commit 3e35697

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

cpp/Binary Search/first_and_last_occurrences_of_a_number.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ std::vector<int> firstAndLastOccurrencesOfANumber(std::vector<int>& nums, int ta
77
}
88

99
int lowerBoundBinarySearch(std::vector<int>& nums, int target) {
10-
if (nums.empty()) return -1;
1110
int left = 0, right = nums.size() - 1;
1211
while (left < right) {
1312
int mid = (left + right) / 2;

0 commit comments

Comments
 (0)