CA 20 - Search in Rotated Sorted Array (opens in new tab)
<p><strong>Problem Statement:</strong> <a href="https://leetcode.com/problems/search-in-rotated-sorted-array/description/" rel="noopener noreferrer">here</a></p> <p><strong>Solution:</strong></p> <ul> <li>The array was originally sorted, but it has been rotated, so it looks broken. However, even after rotation, at any moment, at least one side of the array will still be properly sorted.</li> <li>So the idea is to keep looking at the middle element and use it to decide where to go next. Firs...
Read the original article