Angad Sandhu
Search
Browse

704_Binary_Search

Source name
704_Binary_Search.py
# File: Leetcode_Solutions_704_Binary_Search.py

"""
Problem Number: 704
Problem Name: Binary Search
Difficulty: Easy
Tags: Array, Binary Search, Neetcode 150
Company (Frequency): Amazon, Apple, Facebook, Google, Microsoft
Leetcode Link: https://leetcode.com/problems/binary-search/description/

DESCRIPTION

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 $O(log n)$ runtime complexity.
"""

Browse the library