The Race
Electrostatics coding There is an F1 race going on and there is just one pit crew for a team. There are
X racers. There is a position matrix, which contains the current position of each of these X racer and
the end point till which point the fuel will get over. Pit crew can put their pit location to just one
place What is the maximum number of racers the pit crew team can attend to? Note: The cars
cannot be re-fueled in pits once their fuel gets over. Input Specifications: input: X number of racers
input2: Position matrix of X racers Output Specification: Return number of racers that can be
serviced, setting up just one pit crew.
Example 1: Imput1: 4 Output: 3
Alternative 1:
Alternative 2:
Alternative 3:
Monica
Monica has cooked N dishes and collected the data on the level of satisfaction for all the dishes from
a guest. The guest returns an array where the ith element of the array is the liking level of the dish.
Also, the time taken to cook the ith dish is i Like-to-time coefficient of a dish is calculated by
multiplying the time taken to cook food with its liking level, Le.. ("input2[1] Total Like-to-time
coefficient is calculated by summing up all individual coefficients of dishes. You want the total Like-
to-time coefficient to be maximum. You can also remove some dishes, in which case, a new
coefficient is calculated using the left dishes Find the maximum sum of all possible Like-to-time
coefficients.
Example 1: input1: 3 input2: (-1,3,4) Output: 17 Output {1,2,4)
Alternative 1:
Alternative 2:
Alternative 3:
Maximum and minimum element of array
Difference between maximum and minimum element of array..... If we taking an array of some
elements then firstly find minimum and maximum element from array and then find difference
between them!
Input:- arr={-7,2,6,-6,18,10}
Output:- 25
Explanation:- when we take array minimum element as -7 and maximum element as 18 then their
difference is 18-(-7) 25 i.e counting from -7 to 18 is 25
Alternative 1:
Alternative 2:
Economics Class
Rick recently got admission at a business school. The first class he attended was Economics and it
was a refresher of concepts like mean and median. Mean is the average of all the numbers in the
data and median is the midde value when all the numbers in the data are sorted in case the number
of elements is odd or when the number of elements is even, it is the average of the two middle
elements. As homework, Rick was given a dataset with a large number of elements, he had to find a
subset of that dataset which would give the largest value of the difference between mean and
median (mean-median) Since it is a tedious task, Rick and you decide to develop a program that
retums a subset of the original amay such that the value of difference of mean and median is largest
in it
Example 1: input1:4 input2: {1,2,3,4}
Alternative 1:
Alternative 2:
Electrostatics
This Innovative Product X Doug is fond of change, every now and then he tries to do new
things. This time, he caught up with a rod comprising of negative (N) and positive (P)
charges. He is asked to calculate the maximum net electrostatic field possible in the region
due to the rod. Note: Assume, Electrostatic Field Total charge* 100 Input Specification:
input1: integer array denoting the magnitude of each charge input2: String denoting nature of
each charge, ith entry represents a sign of charge at ith location in input1 input3: No. of
charges it holds (length of input1) Output Specification: Return the maximum electrostatic
field possible in the rod.
Example 1: input1: (4,3,5) input2: PNP input3: 3 Output: 600
Alternative 1:
Sub Array:
Alternative 1:
Alternative 2: