## Find element position in given monotonic sequence

Given an integer k and a monotonic increasing sequence: f(n) = an + bn [log2(n)] + cn^3 where (a = 1, 2, 3, …), (b… Read More »

## Find if array has an element whose value is half of array sum

Given a sorted array (with unique entries), we have to find whether there exist an element(say X) which is exactly half the sum of all… Read More »

## Count elements such that there are exactly X elements with values greater than or equal to X

Given an array arr of N integers, the task is to find the number of elements that satisfy the following condition: If the element is… Read More »

## Search in a sorted 2D matrix (Stored in row major order)

Given an integer ‘K’ and a row-wise sorted 2-D Matrix i.e. the matrix has the following properties: Integers in each row are sorted from left… Read More »

## Program to find Nth term divisible by a or b

Given two integers and . The task is to find the Nth term which is divisible by either of or . Examples : Input :… Read More »

## Find minimum speed to finish all Jobs

Given an array A and an integer H where and . Each element A[i] represents remaining pending jobs to be done and H represents hours… Read More »

## Number of anomalies in an array

Given an array A of N integers. An anomaly is a number for which the absolute difference between it and every other number in the… Read More »

## Meta Binary Search | One-Sided Binary Search

Meta binary search (also called one-sided binary search by Steven Skiena in The Algorithm Design Manual on page 134) is a modified form of binary… Read More »

## Kth Smallest sum of continuous subarrays of positive numbers

Given an sorted array of positive numbers our tasks is to find the kth smallest sum of continuous subarray. Examples: Input : a[] = {1,… Read More »

## Binary Search In JavaScript

Binary Search is searching technique which works on Divide and Conquer approach. It used to search any element in a sorted array. As compared to… Read More »

## Longest Subarray with Sum greater than Equal to Zero

Given an array of N integers. The task is to find the maximum length subarray such that the sum of all its elements is greater… Read More »

## Queries to check if a number lies in N ranges of L-R

Given N ranges and Q queries consisting of numbers. Every range consists of L and R. The task is to check if the given number… Read More »

## Maximize the product of four factors of a Number

Given an integer N, the task is to find the maximum product of A, B, C, D such that below conditions satisfy: N%A ==0 &&… Read More »

## Binary Search (bisect) in Python

Binary Search is a technique used to search element in a sorted list. In this article, we will looking at library functions to do Binary… Read More »

## Cut all the rods with some length such that the sum of cut-off length is maximized

Given N rods of different lengths. The task is to cut all the rods with some maximum integer height ‘h’ such that sum of cut-off… Read More »