All Medium Articles
IntStream iterator() returns an iterator for the elements of this stream. It is a terminal operation i.e, it may traverse the stream to produce a… Read More
Reason: To Ensure Backward Compatibility What is Backward Compatibility? Backward compatibility is a term used to describe software or hardware that is compatible with previous… Read More
Given a stream of integers, look up the rank of a given integer x. The rank of an integer in-stream is “Total number of elements… Read More
You are given an array A[] of n-elements. There are two players Alice and Bob. A Player can choose any of element from array and… Read More
Place the numbers 1, 2, 3, 4, 5, 6, 7, 8 into the eight circles in the figure given below, in such a way that… Read More
Sequence Containers In standard template library they refer to the group of container class template, we use to them store data. One common property as… Read More
Given two arrays X[] and Y[] with n-elements, where (Xi, Yi) represent a point on coordinate system, find the smallest rectangle such that all points… Read More
Below given are some methods which can be used to convert Stream to Set in Java. Method 1 : Using Collectors Stream collect() method takes… Read More
Given a set of non-overlapping intervals and a new interval, insert the interval at correct position. If the insertion results in overlapping intervals, then merge… Read More
Given two positive integer N, M. The task is to check if N and M are friendly pair or not.  In number theory, friendly pairs… Read More
Given an array of N integers, using ‘+’ and ‘-‘ between the elements check if there is a way to form a sequence of numbers… Read More
Given an array of positive numbers and a number k, find the number of subarrays having product exactly equal to k. We may assume that… Read More
This article is about generating Power set in lexicographical order.  Examples :  Input : abcOutput : a ab abc ac b bc c The idea… Read More
We generally iterate through the list when adding integers in a range, but java.util.stream.Stream has a sum() method that when used with filter() gives the… Read More
Given a tree with N nodes and N-1 edges, find out the maximum height of the tree when any node in the tree is considered… Read More
Given three positive integers a, b and d. You are currently at origin (0, 0) on infinite 2D coordinate plane. You are allowed to jump… Read More
You are given a sequence of n elements to sort. The input sequence consists of n/k subsequences,each containing k elements. The elements in a given… Read More
Consider the following four schedules due to three transactions (indicated by the subscript) using read and write on a data item X, denoted by r(X)… Read More
In mathematics, the Golomb sequence is a non-decreasing integer sequence where n-th term is equal to number of times n appears in the sequence.The first… Read More
Lex is a computer program that generates lexical analyzers, which is commonly used with the YACC parser generator. Lex, originally written by Mike Lesk and… Read More