Search in Rotated Sorted Array II

Learning 1D Array Binary Search DSA practice problem on Onlearn.

Difficulty: medium.

Topics: Search in Rotated Sorted Array II (with Duplicates), Arrays, Binary Search, Linear Search, Time Complexity, Space Complexity, Big O Notation, Loops, Conditional Statements, array properties, divide and conquer, search space optimization, duplicate handling, search algorithms, binary search, time complexity analysis, Sorted & Rotated Arrays, Binary Search Variants.

Given an integer array arr of size N, sorted in ascending order (which may contain duplicate values). This array is then rotated at some pivot point unknown to you. Your task is to determine if a given target value k is present in the array. Return True if k is found, and False otherwise. Input Format: An integer array arr. An integer k (the target value). Output Format: True if k is present in arr, False otherwise. Example 1: Example 2: