Solved LeetCode program · 33 of 1,000
#0033 · Search in Rotated Sorted Array
Original English source
Start with the list of numbers 4, 5, 6, 7, 0, 1, and 2. The target is 0. The answer is -1.
For every position from 0 to the last position of numbers.
If item position of numbers is target, set answer to position, then stop.
Show answer.
Expected stdout
4