Problem Solving/LeetCode
2023.08.10 Today's Challenge
fabichoi
2023. 8. 10. 23:45
https://leetcode.com/problems/search-in-rotated-sorted-array-ii/
Search in Rotated Sorted Array II - LeetCode
Can you solve this real interview question? Search in Rotated Sorted Array II - There is an integer array nums sorted in non-decreasing order (not necessarily with distinct values). Before being passed to your function, nums is rotated at an unknown pivot
leetcode.com
이분탐색을 활용하여 푸는 문제
class Solution:
def search(self, nums: List[int], target: int) -> bool:
for i in nums:
if target in nums:
return True
return False
반응형