Detail Form
We will send your result on your email id and phone no. please fill detail
Given a sorted doubly linked list of positive distinct elements, the task is to find pairs in a doubly-linked list whose sum is equal to given value x, without using any extra space
Example:
Input : head : 1 <-> 2 <-> 4 <-> 5 <-> 6 <-> 8 <-> 9 x = 7 Output: (6, 1), (5,2)
The expected time complexity is O(n) and auxiliary space is O(1).
Given an array nums of n elements and q queries . Each query consists of two integers l and r . You task is to find the number of elements of nums[] in range [l,r] which occur atleast k times.
Example 1:
Your Task:
Your task is to complete the function solveQueries() which takes nums, Queries and k as input parameter and returns a list containg the answer for each query.
Expected Time Complexity: O(n*sqrt(n)*log(n))
Expected Space Compelxity: O(n)
Constraints:
1 <= n, no of Queries, k <= 104
1 <= nums[i] <= 103
1 <= Queries[i][0] <= Queries[i][1] <= n
Given an array of integers. Write a program to find the K-th largest sum of contiguous subarray within the array of numbers which has negative and positive numbers.
Examples: