- May 23, 2010 · Decreasing order of integers from a stream of infinite numbers. Given stream of infinite no of integers and a function named getnext() which gives the next integer from stream continuously.U have to store the numbers in decreasing order and remove duplicate also in efficient manner.
- Latest Software Download. Learn Computer Tips, Fix PC Issues, tutorials and performance tricks to solve problems.

- Map<Integer, Integer> map = new HashMap<>()
- Oct 16, 2019 · You are given an array A[] with n elements. You need to find the maximum sum of a subarray among all subarrays of that array. A subarray of array A[] of length n is a contiguous segment from A[i] through A[j] where 0<= i <= j <= n.

- Jun 04, 2020 · So, if the input is like [1,2,3,1,4] and K = 3, then the output will be 4, as it can form three subarrays with exactly four distinct integers, these are [1,2,3], [1,2,3,1], [2,3,1], [3,1,4]. To solve this, we will follow these steps − Define a function atMost(), this will take an array a and variable k, Define one set current
- Aug 05, 2019 · Given an array A of positive integers, call a (contiguous, not necessarily distinct) subarray of A good if the number of different integers in that subarray is exactly K. (For example, [1,2,3,1,2] has 3 different integers: 1, 2, and 3.) Return the number of good subarrays of A. Example 1:
- // Merge subarrays in bottom up manner. First merge subarrays of // size 1 to create sorted subarrays of size 2, then merge subarrays // of size 2 to create sorted subarrays of size 4, and so on. for (curr_size= 1; curr_size<=n-1; curr_size = 2 *curr_size) {// Pick starting point of different subarrays of current size