On Campus || NIT
Round 1 : Online round on hackerrank
Question 1: [Easy - 50]
There are books in a shelf, Either type of X or Y, Your mom wants to make sure before your birthday party, shelf is arranged. All the X type of books should be on left, and all the books of type Y should be on right.
Question 2: [Medium - 100]
You have been given A and B in range.
1<=A<=100,000 and A<=B<=100,000
You need to return the answer as a string in the form of, "C x 10^D"
If C has more than 10 digits, then output C as 12345...12345 x 10^D
Example 1:
7 7
Output: 49 x 10^0
Example 2:
1 17
Output: 355687...28096 x 10^3 Question 3: [Medium - 100]
You have been given an array, which represents height of light towers. For every tower, it's range is (A*B % 1000000007) where :
A = (Buildings visible on left side + Buildings visible on right side)
B = position of light tower in the array (1...N) [1 based indexing]
Now, You have to return the position of lighthouse which has maximum range. If two have same range, return the one with minimum B (leftmost).
Question 4: [Medium - 150]