Skip to content

Latest commit

 

History

History
17 lines (16 loc) · 290 Bytes

Search in Rotated Sorted Array.md

File metadata and controls

17 lines (16 loc) · 290 Bytes

leetcode_Search in Rotated Sorted Array

var search = function(nums, target) {
    let answer=-1;
    nums.forEach((element,index)=>{
        if(element==target){
            answer=index
        }
    })
  return answer==-1?  -1 :  answer
};