KUNALkunaltheengineer.hashnode.dev·Oct 22, 2024Intersection of Two ArraysLevel: Easy Topics: Array, Hash Table, Two Pointers, Binary Search, Sorting Given two integer arrays nums1 and nums2, return an array of their intersection. Each element in the result must be unique and you may return the result in any order. Example...1 like·27 readsCodingarray
Jyotiprakash Mishrablog.jyotiprakash.org·Sep 26, 2024Introduction to SearchingSearching is the process of finding a particular element in a collection of items, such as an array, list, or database. The goal of searching is to locate the position of the desired item in the collection, if it exists, or to determine that the item...554 readssearchin
Saurav Maheshwarixauravww.hashnode.dev·Sep 15, 2024Efficiently Locate the First Bad Version of a Product with Binary SearchProblem Statement You're given a function isBadVersion(version) that returns whether a version is bad. You have a series of versions numbered from 1 to n, and your task is to find the first bad version. Once a version is bad, all the following versio...44 readsData Structures and Algorithmscoding
Saurav Maheshwarixauravww.hashnode.dev·Sep 15, 2024How Binary Search Makes Number Guessing EasyProblem Statement You are playing a game where a number is picked from 1 to n, and you have to guess the picked number. For each guess you make, you are given feedback: If your guess is higher than the picked number, the API returns -1. If your gue...42 readsData Structures and Algorithmscoding
Micah Ondiwamicahondiwa.hashnode.dev·Sep 15, 2024A Structure a Day #Day 0Problem Description: Given a list of numbers obtained by rotating a sorted list an unknown number of times, write a function to determine the minimum number of times the original sorted list was rotated to obtain the given list. Your function should ...10 likesTree rotation
Arkadipta Kunduarkadiptakundu.hashnode.dev·Sep 1, 2024The Ultimate Guide to Using Binary Search on Rotated and Repeated Arrays !Binary search is a fundamental algorithmic technique used to efficiently locate elements in a sorted array. It is always used when the array is sorted. But what do you do if there are multiple elements in that array or the array is sorted but rotated...10 likesBinary Search Algorithm
Dhruv Chouhandestroycompiler.hashnode.dev·Jul 30, 2024Binary Search - perfect_0Binary search is one of the most important algorithms of the world. This guide is for complete beginners and will help you understand and implement the binary search algorithm in code. It will explain the intuition behind binary search and teach you...53 likes·353 readsBinary Search Algorithm
Chetan Dattachetan77.hashnode.dev·Jul 22, 2024Matrix MedianProblem Given a row wise sorted matrix of size R*C where R and C are always odd, find the median of the matrix. (link) Example 1: Input: R = 3, C = 3 M = [[1, 3, 5], [2, 6, 9], [3, 6, 9]] Output: 5 Explanation: Sorting matrix elements giv...LeetcodeMatrix-Median
Chetan Dattachetan77.hashnode.dev·Jul 21, 20241901. Find a Peak Element IIProblem A peak element in a 2D grid is an element that is strictly greater than all of its adjacent neighbors to the left, right, top, and bottom. Given a 0-indexedm x n matrix mat where no two adjacent cells are equal, find any peak element mat[i][j...Leetcode1901. Find a Peak Element II
Chetan Dattachetan77.hashnode.dev·Jul 21, 2024240. Search a 2D Matrix IIProblem Write an efficient algorithm that searches for a value target in an m x n integer matrix matrix. This matrix has the following properties: Integers in each row are sorted in ascending from left to right. Integers in each column are sorted i...Leetcodesearch-a-2d-matrix-ii