61. Search in Rotated Sorted Array
30 Jul 2020 | Daily Algorithms
class Solution {
public:
int search(vector<int>& nums, int target) {
int i = 0;
for(auto k : nums)
{
i++;
if(k==target)
return i-1;
}
return -1;
}
};
class Solution {
public:
int search(vector<int>& nums, int target) {
int i = 0;
for(auto k : nums)
{
i++;
if(k==target)
return i-1;
}
return -1;
}
};
Comments