Finding Min in Rotated Sorted Array with Binary Search

📅 Day 90 of #100DaysOfCode Problem: Find Minimum in Rotated Sorted Array (LeetCode 153) Approach (Binary Search): 1️⃣ Used two pointers: left and right. 2️⃣ Found mid in each iteration. 3️⃣ If nums[mid] > nums[right], it means the minimum lies in the right half → move left = mid + 1. 4️⃣ Otherwise, the minimum lies in the left half (including mid) → move right = mid. 5️⃣ Continued until left == right, which gives the minimum element. #100DaysOfCode #LeetCode #DSA #BinarySearch #Arrays #ProblemSolving #Cplusplus #CodingChallenge #Programming #DeveloperLife #DailyDSA #KeepLearning #TechCommunity #GrowthMindset #Motivation

  • text

To view or add a comment, sign in

Explore content categories