mirror of
https://github.com/krahets/hello-algo.git
synced 2025-07-25 19:22:27 +08:00
fix(docs/cpp): fix error: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Werror=sign-compare]
This commit is contained in:
@ -22,7 +22,7 @@ vector<int> randomNumbers(int n) {
|
||||
|
||||
/* 查找数组 nums 中数字 1 所在索引 */
|
||||
int findOne(vector<int>& nums) {
|
||||
for (int i = 0; i < nums.size(); i++) {
|
||||
for (size_t i = 0; i < nums.size(); i++) {
|
||||
if (nums[i] == 1)
|
||||
return i;
|
||||
}
|
||||
|
Reference in New Issue
Block a user