## Triplets in array with absolute difference less than k

Given an array A[] of n elements and an integer k. The task is to find the number of triplet (x, y, k), where 0… Read More »

- Binary Search in Java
- Eggs dropping puzzle (Binomial Coefficient and Binary Search Solution)
- Find the Missing Number in a sorted array
- Longest subarray having average greater than or equal to x
- Largest subarray having sum greater than k
- Find the index of an array element in Java
- Longest Subarray with Sum greater than Equal to Zero
- Find the only missing number in a sorted array
- Kth Smallest sum of continuous subarrays of positive numbers
- Subarray whose sum is closest to K
- Variants of Binary Search
- Minimum in an array which is first decreasing then increasing
- Meta Binary Search | One-Sided Binary Search
- Binary Search a String
- Binary Search In JavaScript
- Longest Subarray with first element greater than or equal to Last element
- Find the maximum possible value of the minimum value of modified array
- Minimum K such that every substring of length atleast K contains a character c
- Find index of first occurrence when an unsorted array is sorted
- Distribute N candies among K people
- Binary Search (bisect) in Python
- Search in a sorted 2D matrix (Stored in row major order)
- Shortest distance between two nodes in an infinite binary tree
- Program to find Nth term divisible by a or b
- Number of anomalies in an array
- Count numbers < = N whose difference with the count of primes upto them is > = K
- Maximize the product of four factors of a Number
- Find if array has an element whose value is half of array sum
- Queries to check if a number lies in N ranges of L-R
- Count numbers in a range having GCD of powers of prime factors equal to 1

Given an array A[] of n elements and an integer k. The task is to find the number of triplet (x, y, k), where 0… Read More »

Prerequisite: Merge Sort for Linked Lists Merge sort is often preferred for sorting a linked list. The slow random-access performance of a linked list makes… Read More »

Given an array and a value k. We have to find the maximum number of equal elements possible for the array so that we can… Read More »

Given two sorted arrays, a[] and b[], task is to find the median of these sorted arrays, in O(log(min(n, m)), when n is the number… Read More »

Given a set of N integers. Find how many subsets of given array have sum between A and B(inclusive). Constraints: 1 ≤ 34 ≤ N,… Read More »

Given a sorted array and a number x, count smaller elements than x in the given array. Examples: Input : arr[] = {10, 20, 30,… Read More »

Given three arrays A, B and C, the task is to find sum of values of all special triplets. A special triplet is defined as… Read More »

Given an array of A of n integers and an array B of m integers find the Maximum Contiguous Subarray Sum of array A such… Read More »

Binary Search is a searching technique used to search an element in a sorted array. In this article, we will learn about how to implement… Read More »

Given a number n, check it is the Stella Octangula number or not. A number of the form where n is a whole number(0, 1,… Read More »

Given a positive number n and precision p, find the square root of number upto p decimal places using binary search. Note : Prerequisite :… Read More »

Given a sorted array of strings which is interspersed with empty strings, write a method to find the location of a given string. Examples: Input… Read More »

Given two sorted matrices mat1 and mat2 of size n x n of distinct elements. Given a value x. The problem is to count all… Read More »

Given an array of n integers sorted in ascending order, write a function that returns a Fixed Point in the array, if there is any… Read More »

Given a n x n strictly sorted matrix and a value x. The problem is to count the elements smaller than or equal to x… Read More »