The TransCompilator

Solved LeetCode program · 33 of 1,000

#0033 · Search in Rotated Sorted Array

Medium Array chunk-01.md

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.

Open in Playground Browse all 1,000 problems

Expected stdout

4