LeetCode 33 | Search in Rotated Sorted Array | Algorithm Explained (Java)

Publicado em: 16 Março 2020
no canal de: Xavier Elon
361
11

The description reads:
"Given an integer array nums sorted in ascending order, and an integer target.

Suppose that nums is rotated at some pivot unknown to you beforehand (i.e., [0,1,2,4,5,6,7] might become [4,5,6,7,0,1,2]).

You should search for target in nums and if you found return its index, otherwise return -1.



Example 1:

Input: nums = [4,5,6,7,0,1,2], target = 0
Output: 4
Example 2:

Input: nums = [4,5,6,7,0,1,2], target = 3
Output: -1
Example 3:

Input: nums = [1], target = 0
Output: -1"

Github: https://github.com/xavierelon1
Github HackerRank Solutions: https://github.com/XavierElon1/Hacker...
Github Leetcode Solutions: https://github.com/XavierElon1/LeetCo...
Facebook:   / xavier.hollingsworth.3  
Instagram:   / xavierelon  
LinkedIn:   / xavier-hollingsworth-524144127  
Twitter:   / elon_xavier  


Nesta página do site você pode assistir ao vídeo on-line LeetCode 33 | Search in Rotated Sorted Array | Algorithm Explained (Java) duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Xavier Elon 16 Março 2020, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 361 vezes e gostou 11 espectadores. Boa visualização!