Day 7 Coding interview questions | Practice Coding | Competitive Coding #amazon #google #adobe #facebook #coding #interviewquestions #shorts #ytshorts #yiutubeviralshorts #yiutubeshorts #viralshorts #viralshortvideo #viral #shortsquestions #challenges #lifechanging #lifechangingvideo #lifechange #lifeset #crackthecode #optimise #crackthecompetition #solve #practice #code #coding #codinglife #codingninjas #leetcode #leetcodequestions #competitive #python #pythonprogramming #pythonforeveryone #pythonforbeginners #pythontutorial #python3 #clanguage #cprogramming #recursive #dictionaries #plaindrome #technology #microsoft #salesforce #mostaskedquestions #package #20lakhs #apple #python #cpp #clanguage #rust #rustlang #javascript #java #golanguage #ruby #leetcodequestionandanswers #hackeranksolutions #intrerviewbit #coding #practicelanguages #paypal
Question:
Binary Search:
Given an array of integers nums which is sorted in ascending order, and
an integer target , write a function to search target in nums . If target
exists, then return its index. Otherwise, return -1 .
You must write an algorithm with 0(log n) runtime complexity