🎁 Exclusive Offer! Join our Telegram Channel to get **special discounts** and updates! 🚀
Solution
Rahul has an integer array called 'arr' of length N containing unique values. He wants to create a balanced tree where each parent node has
smaller valued nodes on its left and larger valued nodes on its right. This balanced tree should ensure that the depth of the two subtrees for every
node doesn't differ by more than one.
Your task is to assist him in creating this type of tree
Asked in: Unstop
People Bought: 0
Price (in Rs): 201.00
Problem Statement
You have a budget of x coins each day to buy beer, and your goal is to buy as many bottles of beer as possible before the price of beer in all shops exceeds your daily budget.
There are N shops, and each shop sells one bottle of beer per day. The price of beer in each shop increases by 1 coin per day after each purchase.
You can visit multiple shops in a single day, but you
Asked in: Unstop
People Bought: 0
Price (in Rs): 101.00
A substring is a group of contiguous characters in a string. For instance, all substrings of abc are [a, b, c, ab, bc, abc].
Given a binary representation of a number, determine the total number of substrings present that match the following conditions:
1. The 0s and 1s are grouped consecutively (e.g., 01, 10, 0011, 1100, 000111, etc.).
2. The number of 0s in the substring is equal to the n
Asked in: Cognizant
People Bought: 0
Price (in Rs): 151.00
How to Attempt?
Chocolate Arrangement
Alex loves chocolate a lot. His brother Sam gifts him 2^N boxes of chocolate. These boxes are arranged in 2 rows denoted by 2 arrays A and B both of size N. Each box of chocolate contains some number of chocolates which is represented by A[i] and B[i] (for 1 <= i <= N).
Alex wants the boxes of chocolate in those 2 rows to be arranged in such a way that the
Asked in: Siemens
People Bought: 0
Price (in Rs): 51.00
In order to ensure maximum security, the developers at Company employ multiple encryption methods to keep user data protected.
In one method, numbers are encrypted using a scheme called 'Pascal Triangle'. When an array of digits is fed to this system, it sums the adjacent digits. It then takes the rightmost digit (least significant digit) of each addition for the next step. Thus, the number of di
Asked in: Amazon
People Bought: 0
Price (in Rs): 50.00
In this problem, you are given an integer array, and you need to perform some operations on the array to make all the elements equal to 0. In one operation, you can select a prefix of the given array and increment or decrement all the elements of the prefix by 1.
You have an array, arr, consisting of n integers. Find the minimum number of operations required to convert every element of this arr
Asked in: Amazon
People Bought: 0
Price (in Rs): 101.00
Prime Jumps
There is a game that is played as follows:
There is a pawn located at cell 0, and its score is 0.
There is a row of n cells numbered from 0 to n-1 from left to right.
Each cell has a value, and the first cell always has a value of 0.
In a single move, the pawn can move either:
one cell to the right, or
some number p cells to the right where p is a prime number ending in 3, e
Asked in: Amazon
People Bought: 0
Price (in Rs): 151.00
2. SQL: Ecommerce Deal Report
An online shop needs a new deal history feature. Create a query that returns a list of the top three seller profiles with the highest total deals in June, 2022.
The result should have the following columns:
first_name / last_name | email | total.
total - the total amount of all deals for a specific profile
The result should be sorted in descending order by
Asked in: Amazon
People Bought: 0
Price (in Rs): 101.00
Delete Even
Given a linked list of integers, return a linked list containing only nodes having odd integers in their node->data field.
Example
n=3
listHead=1->4->7
The linked list containing only nodes having odd integers is 1 -> 7.
Function Description
Complete the function deleteEven in the editor below.
deleteEven has the following parameter(s):
list listHead: a reference t
Asked in: Amazon
People Bought: 0
Price (in Rs): 51.00
String Subarrays
Problem Statement
Aarav, an aspiring linguist and programming enthusiast, enjoys finding patterns in words and letters. One day, while reading about the importance of vowels in the English language, he stumbles upon an interesting problem that blends his love for both linguistics and coding.
He is given an array of size N, where each element is a single English alphabet. As
Asked in: Walmart
People Bought: 0
Price (in Rs): 51.00