Binary Search (#704)

Problem Statement Link: LeetCode Complexity: Easy 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. Example 1: Input: nums = [-1,0,3,5,9,12], target = 9 Output: 4 Explanation: 9 exists in nums and its …

Binary Search (#704) Read More »

Median of Two Sorted Arrays

Problem Statement Link: LeetCode Complexity: Hard Given two sorted arrays nums1 and nums2 of size m and n respectively, return the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)). Example 1: Input: nums1 = [1,3], nums2 = [2] Output: 2.00000 Explanation: merged array = [1,2,3] and median is 2. Example 2: Input: nums1 = [1,2], nums2 = [3,4] Output: …

Median of Two Sorted Arrays Read More »

Working with Numpy

Numpy is a powerful library for mathematical computing and data manipulation in Python. It provides a robust and efficient array data structure for numerical computing, allowing for vectorized operations and efficient computation of mathematical operations on large datasets. With Numpy, you can perform a wide range of operations including statistical analysis, linear algebra, and signal …

Working with Numpy Read More »

Working with Pandas

Pandas is a powerful and popular library for data analysis and manipulation in Python. It provides easy-to-use data structures and data analysis tools to handle, clean, and process large datasets. With its rich features, pandas makes it easier to explore, manipulate and transform data, making it the go-to tool for data engineers and data scientists. …

Working with Pandas Read More »

Python Data Types

Tuple A tuple is a built-in data structure in Python that represents an ordered, immutable collection of elements. Here’s an example of how to create a tuple in Python: You can access elements in a tuple using indexing: Sets A set is a built-in data structure in Python that represents an unordered collection of unique …

Python Data Types Read More »

Scroll to Top