mirror of
https://github.com/krahets/hello-algo.git
synced 2025-07-27 04:12:40 +08:00
feat(codes/cpp): revert the changes size_t
back to int
This commit is contained in:
@ -9,7 +9,7 @@
|
||||
/* 线性查找(数组) */
|
||||
int linearSearch(vector<int>& nums, int target) {
|
||||
// 遍历数组
|
||||
for (size_t i = 0; i < nums.size(); i++) {
|
||||
for (int i = 0; i < nums.size(); i++) {
|
||||
// 找到目标元素,返回其索引
|
||||
if (nums[i] == target)
|
||||
return i;
|
||||
|
Reference in New Issue
Block a user