Skip to content

Commit 1b3b375

Browse files
authored
Create 81. Search in Rotated Sorted Array II
1 parent f7aa25f commit 1b3b375

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

81. Search in Rotated Sorted Array II

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
public class Solution {
2+
public boolean search(int[] nums, int target) {
3+
// Brute force 有重复根本就不需要法二分法了,最差情况就是o(n)
4+
for(int i = 0; i < nums.length; i++){
5+
if(nums[i] == target){
6+
return true;
7+
}
8+
}
9+
return false;
10+
11+
}
12+
}

0 commit comments

Comments
 (0)