Deloite Coding problem
Deloite Coding problem
Please be aware that this National Level Assessment has a 90-minute time limit and is divided into 4
sections, which are mentioned below :
Problem Statement :
After JEE Mains, some students got admission into an engineering college. Now there is a class
consisting of such n students, and the HOD came to say it is time to select the class monitor. But He
never gets all of them at one time. So he brought a register, every time he gets someone with less
rank than the previous time he cut the name and wrote the name of the student and the rank.
For a given number of ranks he gets each time, you have to predict how many names are cut in the
list.
Constraints:
Number of Visiting<=10^9
ranks <=10000
Input Format:
Number of Visiting N in their first line
N space separated ranks the HOD gets each time
Output Format:
Number of ranks cut in the list
Sample Input:
6
437261
Sample Output:
3
C++
JAVA
Python
Question 2 : Corona for Computer
Problem Statement :
Every decimal number can be changed into its binary form. Suppose your computer has it’s own
CoronaVirus, that eats binary digits from the right side of a number. Suppose a virus has 6 spikes, it
will eat up 6 LSB binary digits in your numbers.
You will have a bunch of numbers, and your machine will have a virus with n spikes, you have to
calculate what will be the final situation of the final numbers.
Input Format:
First line, a single Integer N
Second line N space separated integers of the bunch of values as array V
Third line a single integer n, the number of spikes in Corona for Computer
Output Format:
Single N space separated integers denoting the final situation with the array v.
Sample Input:
5
12345
2
Output:
00011
Explanation:
5 is 101 in binary, when you cut the last two binary digits, its 1.
Problem Statement :
Arnab has given me a challenge. I have to calculate the number of numbers which are less than a
certain value n, and have exactly k set bits in its binary form. As you are a Prepster like me, help me
write a code that will take input for n and k and give the expected output.
Constraints :
1<=n<=10000
1<=k<=10
Input Format :
First line containing n and k space separated
Output Format :
Number of numbers present in a single line
Sample Input:
72
Sample Output:
3
Explanation:
11,110,101 -> These three numbers.
Ratul made a linked list, a list made of n nodes, where every node has two variables, the velocity and
the mass of a particle.
Since all the particles have the velocity in the same direction, find the total momentum of the entity
made by the particles from the linked list.
Constraints :
1<=n<=10000
1<=m,v<=100
Input format:
First line containing n, number of nodes
Then n lines containing the mass and the velocity space separated.
Output Format:
Single integer denoting the momentum
Sample Input:
4
13
24
23
45
Sample Output:
37