Tip 1: Solve problems to gain hands-on confidence.
Tip 2: Solve high-quality questions.
Tip 3: Attempt to solve questions independently before resorting to YouTube videos for guidance.
Tip 1: Include projects on your resume.
Tip 2: Avoid putting false information on your resume.



ARR = [5, 7], N = 2, M = 2
Perform the following two operations on ‘ARR’:
1. Divide the bag with 7 balls into 3 and 4. New ARR = [3, 4, 5].
2. Divide the bag with 5 balls into 1 and 4. New ARR = [1, 3, 4, 4].
The bag with the maximum number of balls has 4 balls. Hence, the minimum possible value of ‘X’ is 4. Return 4 as the answer.
1. You can perform any number of operations between [0, M], both included.
2. Avoid using the 'Modulo' operator as it can cause Time Limit Exceeded.
You are given an integer array ‘ARR’ of size ‘N’, where ‘ARR[i]’ denotes the number of balls in the ‘i-th’ bag. You are also given an integer ‘M’, denoting the maximum number of operations you can perform on ‘ARR’ (the given collection of bags).



Input: 'a' = [7, 12, 1, 20]
Output: NGE = [12, 20, 20, -1]
Explanation: For the given array,
- The next greater element for 7 is 12.
- The next greater element for 12 is 20.
- The next greater element for 1 is 20.
- There is no greater element for 20 on the right side. So we consider NGE as -1.
You are given an array 'a' of size 'n'.
Print the Next Greater Element(NGE) for every element.
The Next Greater Element for an element 'x' is the first element on the right side of 'x' in the array, which is greater than 'x'.
If no greater elements exist to the right of 'x', consider the next greater element as -1.



fib(0) = 0
fib(1) = 1
fib(n) = fib(n-1) + fib(n-2), n >= 2, where fib(n) represents the nth fibonacci number.
Given two integers, ‘N’ and ‘M’, your task is to find the sum of Fibonacci numbers between ‘fib(N)’ and ‘fib(M)’ where ‘fib(N)’ represents the Nth Fibonacci number and ‘fib(M)’ represents the Mth Fibonacci number. The sum is given by sum(N, M) = fib(N) + fib(N+1) + fib(N+2) … fib(M). Since the answer could be large, so you have to return the sum modulo 10^9 + 7.



Input:
‘ARR’ = [-6,-3, 2, 1, 5]
If we take a square of each element then the array/list will become [36, 9, 4, 1, 25].
Then the sorted array/list will be [1, 4, 9, 25, 36].
Output :
[1, 4, 9, 25, 36].
You are given an array/list ‘ARR’ of ‘N’ integers. You have to generate an array/list containing squares of each number in ‘ARR’, sorted in increasing order.


1 ‘X’ N: Enqueue element ‘X’ into the end of the nth queue. Returns true if the element is enqueued, otherwise false.
2 N: Dequeue the element at the front of the nth queue. Returns -1 if the queue is empty, otherwise, returns the dequeued element.
Please note that Enqueue means adding an element to the end of the queue, while Dequeue means removing the element from the front of the queue.
You will be given ‘N’ queries. You need to implement ‘N’ queues using an array according to those queries. Each query will belong to one of these two types:
1 ‘X’ N: Enqueue element ‘X’ into the end of the nth queue. Returns true if the element is enqueued, otherwise false.
2 N: Dequeue the element at the front of the nth queue. Returns -1 if the queue is empty, otherwise, returns the dequeued element.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
What is recursion?